How to find id for custom field(s)?

Still need help?

The Atlassian Community is here for you.

Ask the community

Summary

This article described several methods to obtain custom field IDs for Jira and Jira Service Management products. Having the custom field ID can be useful when working with API payloads or running SQL queries (Server or Data Center), which require the ID as opposed to the field name.

Using Jira Home Directory and DB Browser plugin

This step is only available in our Server and Data Center products.

  1. To run the following steps, make sure you have the JIRA Administrator permission.
  2. Install Jira Home Directory And DB Browser.  
  3. Navigate to the Db Console.

  4. Select the customfield table and Execute.

Using URL

Please note, the Administer Jira Global permission is necessary to complete these steps.

  1. Navigate to Settings () > Issues > Custom fields under the Fields section
  2. Click on the More () icon to the right of the custom field you are obtaining the ID
  3. Select the View field information option
  4. Observe the URL in your browser, which will contain the ID of the field:

In the above example, the custom field ID is 10026.

Using API

Using the Get Fields Jira Cloud API endpoint, custom fields can be returned in a list. Please see the Cloud REST API documentation or the JIRA Server REST API references 8.13.9/8.18.1 and earlier or 8.13.10/8.18.2 and later for additional examples and rules relating to using this endpoint. The returned JSON data will need to be filtered to identify the field you are looking for and its ID.

Sample response from the API:


{  
    "id": "customfield_10026",
    "key": "customfield_10026",
    "name": "Approvals",
    "untranslatedName": "Approvals",
    "custom": true,
    "orderable": true,
    "navigable": true,
    "searchable": true,
    "clauseNames": [
        "Approvals",
        "Approvals[Approvals]",
        "cf[10026]"
    ],
    "schema": {
        "type": "sd-approvals",
        "custom": "com.atlassian.servicedesk.approvals-plugin:sd-approvals",
        "customId": 10026
    }
}

Export to XML

The custom field IDs used by issues can be retrieved by exporting the issue to XML within the Jira and Jira Service Management user interface. This method will show field IDs for fields present on the issue only.

  1. Open up the issue that you want to get the custom field ID for
  2. Click the Actions () icon towards the top right corner
  3. Select the Export to XML option, which will open up a new tab with the issue details in XML format
  4. Search for the field name to identify it's custom field ID


<customfield id="customfield_10026" key="com.atlassian.servicedesk.approvals-plugin:sd-approvals">
    <customfieldname>Approvals</customfieldname>
    <customfieldvalues> </customfieldvalues>
</customfield>

In the above example the custom field ID is 10026 for the Approvals field.


From Database

Using the below DB query:

jiradb=# select id from customfield where cfname='Approvals' ;
  id   
-------
 10026
(1 row)

jiradb=# 

Last modified on Mar 16, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.