Identifying custom field names in Jira Python API

I’m working with the Jira Python API and I’m having trouble figuring out how to match the custom field names I see in the Jira GUI with the customfield_xxx format returned by the API. Is there a way to get this mapping without manually checking each field?

For example, I can see fields like ‘project’, ‘name’, and ‘due date’ in the Jira interface, but when I fetch an issue through the API, I get customfield_10801 and similar.

I’ve tried setting a value in the GUI and then fetching the issue to see where it appears, but this seems like a tedious process. Is there a more efficient method to find out which customfield_xxx corresponds to ‘due date’ or any other custom field?

Also, is there a way to look up these custom field numbers directly in the Jira GUI? Any help would be appreciated!

I’ve dealt with this exact issue before, and it can be frustrating. Here’s what worked for me:

Use the Jira API to fetch the field configurations for your project. There’s an endpoint specifically for this: ‘/rest/api/2/field’. It returns a list of all fields, including custom ones, with their IDs and names.

In Python, you can do something like:

fields = jira.fields()
custom_field_map = {field[‘id’]: field[‘name’] for field in fields if field[‘custom’]}

This gives you a dictionary mapping ‘customfield_xxx’ to its actual name. You can then use this map to look up the human-readable names when working with issues.

As for the GUI, sadly, there’s no easy way to see the field IDs directly. But once you have this mapping, you can create a small tool to quickly look up fields as needed. It’s saved me hours of headache in the long run.

In my experience, relying on the Jira API’s ability to fetch field definitions is the most efficient solution. Instead of tedious manual checks, use the jira.fields() method to grab all the details on fields, including custom ones. For example, you can build a mapping like:

custom_fields = {field[‘name’]: field[‘id’] for field in jira.fields() if field[‘custom’]}

This mapping lets you quickly locate a field’s ID by its friendly name, such as using custom_fields[‘Due Date’] to find the corresponding customfield_xxx. This approach simplifies managing changes and multiple projects.

yo, ive run into this too. super annoying right? heres a quick tip: try using the jira.fields() method. it’ll give u all the field info including custom ones. then u can make a dict like this:

field_map = {f[‘id’]: f[‘name’] for f in jira.fields() if f[‘custom’]}

this way u can look up names easily. hope it helps!