JIRA API permissions/parent issues

John Light October 15, 2024

I'm using python to query my JIRA board so display that data elsewhere. I'm able to display all the issues, but not their parent issues (if they have one). I believe I saw somewhere that this is a API permission issue, but I was unable to figure out how to give the API permissions to view parents issues. Right now, if I run these commands: 

 

parent_link = issue.fields.customfield_10008 
        if parent_link:
            print(f'{issue.key}: {issue.fields.summary} - Parent: {parent_link.key}')
        else:
            print(f'{issue.key}: {issue.fields.summary} - No Parent')
It returns all the issues and say they have "No Parent," even though some of them do. This is my first time using the JIRA API, so any help would be appreciated.

1 answer

0 votes
Abdallah Khaled
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 17, 2024

Hi @John Light, if the user who runs the API can see the Parent issues on the site, this means they have the right permissions to run the API, therefore, Ensure that the user or API token you are using has the necessary permissions to view parent issues. This typically involves having "Browse Projects" permission for the projects containing both the child and parent issues.

Also, it seems that you're using "parent_link = issue.fields.customfield_10008 " for the parent reference. This could be the issue, as the parent reference field is named "Parent." You can double-check that on one of the child issues using this API here.

John Light October 17, 2024

What should be custom field number be? Or how should that line be structured? I just saw that somewhere online, so I'm not sure what should be there.

Abdallah Khaled
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 18, 2024

It should be issue.fields.parent, you can try this in your code, you can also check all field IDs from this API end point here.

Like John Light likes this
John Light October 18, 2024

Great, that worked. Where did you find that it should be structured as "issue.fields.parent"? Just so I know where I can reference if I want to see other attributes of issues.

Abdallah Khaled
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 22, 2024

You should typically find any field reference by calling this API endpoint.

 

you will just need to structure the returned JSON response using a browser add-on or any other tool

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events