How to get a fields type or schema

We are trying to use JIRA API to understand the schema of a custom field in our project. We are basically trying to build a connector that can understand the data in a generic way. As an example, in our fields document, we have the following

    "id": "customfield_10020",
    "key": "customfield_10020",
    "name": "Sprint",
    "untranslatedName": "Sprint",
    "custom": true,
    "orderable": true,
    "navigable": true,
    "searchable": true,
    "clauseNames": ["cf[10020]", "Sprint"],
    "schema": {
      "type": "array",
      "items": "json",
      "custom": "com.pyxis.greenhopper.jira:gh-sprint",
      "customId": 10020

Now, looking at the data, we do understand that the schema for com.pyxis.greenhopper.jira:gh-sprint looks something like:

        "id": 1,
        "name": "MS Sprint 1",
        "state": "active",
        "boardId": 1,
        "goal": "",
        "startDate": "2022-06-18T09:00:44.236Z",
        "endDate": "2022-06-25T09:00:00.000Z"

but we are trying to do this in a generic way if possible. The ask here is to point us to a way we can figure out the schema of a data type.

1 Like