Python Jira library - custom field not accessible with issue() method

I’m working with the Python Jira library version 3.8.0 and trying to retrieve a custom field value called customfield_10015 which stores story points for our tasks. When I use the jira.issue() method, the custom field doesn’t seem to be available.

Here’s what I’m trying to do:

task = jira.issue('PROJ-123')
points = task.fields.customfield_10015
print(points)

The field appears to be missing when I run this code.

I’ve attempted several approaches without success:

# Method 1
task = jira.issue('PROJ-123', fields='customfield_10015')

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

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

Interestingly, when I use the search functionality, everything works perfectly:

results = jira.search_issues('key = PROJ-123')
for task in results:
    points = task.fields.customfield_10015
    print(points)

But this search approach is too slow for my needs since I have to process many issues. Is there a way to make the jira.issue() method properly return custom fields? Any help would be appreciated!

Had the same headache a few months back when we were pulling story points for sprint planning. The issue() method is super finicky with custom fields.

I stopped fighting Jira’s weird API and just automated it with Latenode instead. You set up a workflow that grabs all your issues with custom fields working properly, then process them however you want. No more field visibility headaches or endpoint weirdness.

I built a scenario that pulls issues from Jira, extracts story points and other custom fields reliably, then pushes the data wherever we need it. Takes maybe 10 minutes to set up and runs way faster than individual API calls.

Best part? You don’t have to figure out why one method works and another breaks. Latenode deals with all the API mess and gives you consistent results.

I’ve hit this exact issue before. It’s usually a field visibility/permissions thing. The custom field might not be accessible through the direct issue() method because it uses different REST endpoints with different contexts. Try adding the expand parameter: jira.issue('PROJ-123', expand='names'). This forces the API to include field metadata. Also check if your API user has the same field permissions as your regular account - service accounts sometimes get restricted access to custom fields. The search method works because it uses a different endpoint that includes more fields by default.

Sounds like field context restrictions. Custom fields in Jira can be set to only show up for certain projects or issue types, and the issue() method’s pretty strict about this. I hit the same thing - the field existed but wasn’t showing because it wasn’t configured for all issue types in my project. Check your Jira admin settings to see if customfield_10015 is actually set up for the issue type you’re querying. Also try the raw parameter: jira.issue('PROJ-123', fields='customfield_10015', raw=True) - sometimes that bypasses the filtering. If it still doesn’t work, your Jira field configuration is probably the problem.

weird, i had the same problm. mine was bc the custom field wasn’t set on that issue. check hasattr(task.fields, 'customfield_10015') first, or use getattr(task.fields, 'customfield_10015', None) to avoid errors. the field just won’t be there if it’s empty.