How to access IDs for Custom Fields in Product Discovery
Asked by Rob Parrish:

Hello,  

I'm trying to setup an automation that needs to leverage a custom field, using the syntax {{destinationIssue.customField}}. You can see an example below of where I'd like to use it.

My question, how do I get the custom field ID for a field I created in Product Discovery? I know how to do it in normal JIRA, but unsure how to here.

Ideally, Atlassian would make getting custom IDs for fields would be A LOT EASIER, because it's always far too cumbersome for the amount of places it's needed in more advanced use cases. I suspect this would drive adoption of these more advanced features. But, for now, I'll just take any way to make this work!  

Thanks in advance!

![Screenshot 2024-02-25 at 7.38.30?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/308540iBE5986CE723023BF/image-dimensions/270x321?v=v2 "Screenshot 2024-02-25 at 7.38.30?PM.png")


Answers:
author: Andy Lutz
body: The other workaround I use for this is via the [Jira Cloud for Sheets](https://support.atlassian.com/jira-work-management/docs/use-jira-cloud-for-sheets/) add-on for Google Sheets. Once you have it set up and launch it within a sheet, within the side panel for the Add-On there's an option to view all Jira Fields:

![Screenshot 2024-02-26 at 11.45.58?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/308700i011A94C0532BC592/image-size/large?v=v2&px=999 "Screenshot 2024-02-26 at 11.45.58?AM.png")

You can then search for specific fields across all projects, or within a specific project:

![Screenshot 2024-02-26 at 11.48.50?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/308702i9761AB4D04B8ABF4/image-size/large?v=v2&px=999 "Screenshot 2024-02-26 at 11.48.50?AM.png")

comments: author: Rob Parrish
body: This one seems particularly simple. Thank you! Let me try it out


author: Dane Kantner
body: please note that there is a [bug in both Jira Cloud for Sheets](https://jira.atlassian.com/browse/API-299) where if you're using the same field name in multiple team managed projects, the customfield_257717 shown in the Jira Cloud For Sheets add-on will not necessarily be the actual correct customfield_identifier that matches the project you've already specified to pull issues from. There is no way to know within this add-on if you're looking at the identifier for the same project or not unless you happen to also know the customfield_id for that project. If you happen to know the customfield_id beforehand you can explicitly add the correct one by searching and you will see that it shows multiple in the list and you can select the correct one; I can reproduce this bug reliably in my projects 100% of the time.

But the functionality where it is attempting to pull the customfield for the correct project you're working in is explicitly broken. Therefore this method is not reliable for locating the custom field i.d. unfortunately in these circumstances.


author: Nick H
body: This doc should help:

[How to find any custom field's IDs](https://confluence.atlassian.com/jirakb/how-to-find-any-custom-field-s-ids-744522503.html)

comments: author: Bill Sheboy
body: Hi [@Nick H](/t5/user/viewprofilepage/user-id/2540930)

Here is the Jira Cloud version of that article...which was removed recently for several weeks, and now is back.

<https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/>

Kind regards,  
Bill


author: Mart Postma
body: Hi [@Rob Parrish](/t5/user/viewprofilepage/user-id/5223867)

If you follow these steps, you'll be able to find the ID of your custom field you are looking for:

**(1)** Call the Atlassian API in your browser: **\<your_domain\>** .atlassian.net/rest/api/3/issue/**\<ISSUE_KEY\>**?expand=names

Enter any issue key from your JPD project such that we can retrieve all fields in an issue in the project.

**(2)** It will return a massive JSON object. Copy this to any JSON editor of your preference, for example <https://jsoneditoronline.org/> and format it accordingly/

**(3)** Query (CTRL-F) with the name of the custom field that you want to find. For example, the result that you should use in your smart value automation step should look like this: **{{customfield_10131}}**

It's a bit of a work-around, but it does the job. Good luck!

comments: author: Ivan Ferreira
body: Hello [@Rob Parrish](/t5/user/viewprofilepage/user-id/5223867) .

Check [this solution](https://community.atlassian.com/t5/Jira-Software-questions/How-do-you-find-a-field-ID-in-a-team-project/qaq-p/1710958). I just tested and it solves your problem.

Cheers!


author: Troy Moore
body: This is really cool! [@Mart Postma](/t5/user/viewprofilepage/user-id/5313648)


author: Bill Sheboy
body: Hi [@Rob Parrish](/t5/user/viewprofilepage/user-id/5223867)

Yes, and...to this suggestion:

This approach will also show the structure of the smart values within the issue. This can help diagnose problems where values appear empty, but in reality the wrong smart value path was selected in the rule.

Kind regards,  
Bill


author: Dane Kantner
body: You can also hover over the actual field label within an issue in the project, then right click and hit inspect. It will show take you to the source on an \<h2\> line that itself is wrapped within a \<div\> element that is usually just one or two lines above it. That div itself shows the customfield_identifier within it. Personally I find this to be the easiest and most reliable method because with team-managed projects the API lookup has become "spoiled" with redundant identifiers if you might use the same actual string name for custom fields in multiple projects. (And the Jira Cloud sheets export method has a pretty big bug in it where it's not reliable/accurate)

```
<div data-testid="issue-field-heading-styled-field-heading.customfield_11917" ...

<h2 ....[where you highlighted to inspect] ...
```


author: Sam Hepworth
body: Consider using [this rest API](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/#api-group-issue-fields)

* In your browser login to Jira.
* Then in your browser url type:  
  https://\<your_domain\>.atlassian.net/rest/api/3/field  
  (replace \<your_domain\> with your Jira domain)
* In the returned JSON search for:  
  "name": "\<field_name\>"  
  (replace \<field_name\> with the name of the custom field, and include the quotes in your search)
* You should now be able to find the field id. It should look something like this:

```
{
  "id": "customfield_10101",
  "key": "customfield_10101",
  "name": "Votes",
  "untranslatedName": "Votes",
  "custom": true,
  "orderable": true,
  "navigable": true,
  "searchable": true,
  "clauseNames": [
    "cf[10101]"
  ],
  "scope": {
    "type": "PROJECT",
    "project": {
      "id": "10001"
  }
  },
    "schema": {
    "type": "number",
    "custom": "jira.polaris:votes",
    "customId": 10101
  }
},
```


Tags: custom-field

id