Is there an restful api to retrieve all the fields including those are not in use?

This api(/rest/api/3/field) only returns the fields at least one project is using, Is there an restful api to retrieve all the fields including those are not in use

Welcome to the Atlassian developer community @RitaZhou.

I just created a custom field. By default, if was not added to any issue schemes, screens, or projects. The field is returned when I get fields using GET /rest/api/3/field:

{
    "id": "customfield_10439",
    "key": "customfield_10439",
    "name": "unused",
    "untranslatedName": "unused",
    "custom": true,
    "orderable": true,
    "navigable": true,
    "searchable": true,
    "clauseNames": [
      "cf[10439]",
      "unused",
      "unused[Paragraph]"
    ],
    "schema": {
      "type": "string",
      "custom": "com.atlassian.jira.plugin.system.customfieldtypes:textarea",
      "customId": 10439
    }

So I don’t think your premise is correct. However, I don’t see anything in the result that would let me know it is unused (aside from the contrived name I chose). I tried to get fields paginated using GET /rest/api/3/field/search and here I can see different metadata.

    {
      "id": "customfield_10439",
      "name": "unused",
      "schema": {
        "type": "string",
        "custom": "com.atlassian.jira.plugin.system.customfieldtypes:textarea",
        "customId": 10439
      },
      "description": "",
      "key": "customfield_10439",
      "isLocked": false,
      "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher",
      "screensCount": 0,
      "contextsCount": 1,
      "lastUsed": {
        "type": "NO_INFORMATION"
      }
    }

I’m pretty sure "screensCount": 0 is effectively unused.

1 Like