Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to access IDs for Custom Fields in Product Discovery

Rob Parrish February 25, 2024

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

5 answers

1 accepted

2 votes
Answer accepted
Andy Lutz February 26, 2024

The other workaround I use for this is via the 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

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

Rob Parrish February 26, 2024

This one seems particularly simple. Thank you! Let me try it out

Dane Kantner July 17, 2024

please note that there is a bug in both Jira Cloud for Sheets 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.

3 votes
Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2024

This doc should help:

How to find any custom field's IDs

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 26, 2024

Hi @Nick H 

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

Like Nick H likes this
3 votes
Mart Postma
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2024

Hi @Rob Parrish 

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! 

Ivan Ferreira February 26, 2024

Hello @Rob Parrish .

Check this solution. I just tested and it solves your problem.

Cheers!

Troy Moore February 26, 2024

This is really cool! @Mart Postma  

Like Mart Postma likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 26, 2024

Hi @Rob Parrish 

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

Like Troy Moore likes this
0 votes
Dane Kantner July 17, 2024

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] ...

 

0 votes
Sam Hepworth June 7, 2024

Consider using this rest API

  • 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
}
},

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events