I’m struggling to get a custom field value using the Python Jira library (version 3.8.0). The field I need is customfield_10032, which stores story points for tasks.
Here’s what I’ve tried:
ticket = jira_client.ticket('TASKFORCE-123')
effort = ticket.fields.customfield_10032
print(effort)
This doesn’t work. The field isn’t there.
I also tried these:
# Try 1
ticket = jira_client.ticket('TASKFORCE-123', fields='customfield_10032')
# Try 2
ticket = jira_client.ticket('TASKFORCE-123', fields='all')
# Try 3
ticket = jira_client.ticket('TASKFORCE-123', fields='*all')
None of these worked either.
Oddly, this method works, but it’s too slow for what I need:
results = jira_client.search_ticket('key = TASKFORCE-123')
for ticket in results:
effort = ticket.fields.customfield_10032
print(effort)
Any tips on how to make jira_client.ticket() work for this? Thanks for any help!
I’ve seen similar issues before with custom fields in Jira. In my experience the problem often comes down to permissions or field configuration rather than the API call itself. It might help to double-check that your account has access to view the custom field and that the field is enabled in the project configuration. Another suggestion is to try expanding the fields during the issue call. For example, using the expand parameter in the issue request can reveal any hidden fields. If that still doesn’t work, consider retrieving the issue details directly through the REST API to access the custom field.
Have you considered using the fields() method instead? It’s been more reliable in my experience. Try something like this:
ticket = jira_client.issue(‘TASKFORCE-123’)
effort = ticket.fields.customfield_10032
If that doesn’t work, you might need to fetch all fields and then access the custom field:
all_fields = ticket.fields()
effort = getattr(all_fields, ‘customfield_10032’, None)
This approach has worked for me when dealing with tricky custom fields. Also, ensure your JIRA instance isn’t using a different field ID for story points. Sometimes they can vary between installations.
hey oscar64, had similar trouble b4. try this:
ticket = jira_client.issue(‘TASKFORCE-123’, expand=‘customfield_10032’)
effort = ticket.raw[‘fields’][‘customfield_10032’]
this worked for me. if not, check ur permissions. good luck!