It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

how to see epic/issue relationship using jira-python's search_issues

I can get epics with the wonderful jira-python project liks this:
jira_connection = JIRA(constants.JIRA_URL, basic_auth=(constants.JIRA_USER_NAME, constants.JIRA_PASSWORD))
jql_query = 'issuetype=Epic'
epics = jira_connection.search_issues(jql_query)
and I can get issues with a different jql_query:
jql_query = 'project=UI'
Of all the fabulous information that comes back for one epic or for one issue, what element indicates that the issue is in the epic, or that the epic contains the issue?
I've been looking both ways, from epic to issue and from issue to epic, particularly searching for the id of one in the data elements of the other, but no luck.
For example, my sample epic has an id of 302486. When examining an issue in the epic, known to be in the epic as seen in the regular Jira UI, I hoped to find an element on the issue with a value of 302486, the epic's id.
Alas, I'm not finding one.
I know that I can use the REST API and loop through all the epics with a REST API call for each one to get their issues, but I'd rather not convert my project to REST API and give up the fantastic ease of use of jira-python.
Plus, I'm harvesting data, so having an API call for each epic isn't optimal
Is there any element returned by search_issues in jira-python that will give the epic to issue or issue to epic relationship? Or any more clever idea?
Thanks so much for a great tool, and any suggestions you may have for a solution.

1 answer

1 accepted

0 votes
Answer accepted

Hi @carmella_smith 

 

You could try this :

proj = jira.search_issues("'Epic Link' is not EMPTY and project = 'your project(s)'")

It will list all issue that belong to an epic. After that with a loop you can access to the epic issue number. 

 

The code below give you access to the epic link issue number.

for i in proj:
print(i.fields.customfield_10405)

I think with loop you can get more informations if you need too

Hope this helps.

Hello Mohamed,

Thanks so much for your post.  Alas, we don't have any customfield_10405 at our local installation.  I'll talk to our site admin to find out about it.  Many thanks.

Hi Carmella,

 

If you want to know the id of the epic link field you need to read this documentation :

https://confluence.atlassian.com/jirakb/how-to-find-id-for-custom-field-s-744522503.html

 

Just replace customfield_10405 with the good id.

 

Hope this helps

Like carmella_smith likes this

Hello Mohamed,

What a great page that documentation is!  It told me everything I needed to know, and I'm now unstuck, thanks to you.  Blessings on you for taking the time to share you knowledge with me; I appreciate it.

 

Thanks,

Carmella

Hello Carmella,

 

I'm so glad i could help you !!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

881 views 7 24
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you