Python Jira library unable to retrieve custom field from specific issue

I’m working with the Python Jira library version 3.8.0 and trying to access a custom field called customfield_10019 which contains effort estimates for tickets. When I use the jira.issue() method, I can’t seem to get the custom field data.

Here’s what I’m trying to do:

ticket = jira.issue('PROJ-123')
effort_points = ticket.fields.customfield_10019
print(effort_points)

The field just doesn’t show up at all.

I’ve tried these different approaches but none work:

# Method 1
ticket = jira.issue('PROJ-123', fields='customfield_10019')

# Method 2  
ticket = jira.issue('PROJ-123', fields='all')

# Method 3
ticket = jira.issue('PROJ-123', fields='*all')

Interestingly, when I use the search method it works perfectly:

results = jira.search_issues('key = PROJ-123')
for ticket in results:
    effort_points = ticket.fields.customfield_10019
    print(effort_points)

But this approach is really slow when I need to process many tickets. Does anyone know why jira.issue() won’t return the custom field data? Any help would be great!

first, make sure the custom field has data for that specific issue - fields can exist but be empty. use hasattr(ticket.fields, 'customfield_10019') to confirm it’s actually there. also check if the field context matches your issue type since that’ll block access.

It seems you might be facing a permissions issue with the project or the custom field. I encountered a similar situation where certain custom fields were inaccessible through the jira.issue() method but were retrievable via search methods. This discrepancy can occur because different API endpoints may have different access rights.

I recommend checking if your API user has the necessary permissions for the custom field in the project settings. Additionally, ensure that the field is configured to be visible universally, as there could be restrictions applied to certain issue types or workflows. Testing a different custom field might also help determine if the problem is isolated to this specific field or a broader issue with your API permissions.

I encountered a similar issue recently. It turned out to be related to the configuration of the custom field’s context in Jira. Custom fields can be restricted to certain projects or issue types, which might explain why jira.issue() is not retrieving the field. To troubleshoot, start by checking the raw JSON data with print(ticket.raw['fields']). Look for your custom field in that output. If it’s missing, the API isn’t returning it for that specific issue. Additionally, examine the visibility settings and screen configurations for the field; it’s possible that it’s accessible in search results but not when retrieving individual issues due to these configurations.