Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

get jira story by python

Yuuki
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 19, 2023

how can I get jira story under the epics by python  jira

1 answer

0 votes
Tuncay Senturk _Snapbytes_
Community Champion
October 22, 2023

Hi @Yuuki 

Welcome to the Community!

To retrieve Jira stories that belong to a specific epic using Python, you can use the jira Python library. Here are the steps;

  • Install the  Python library:
    pip install jira
  • Import the library and authenticate with your Jira instance:
    from jira import JIRA

    jira_url = 'https://url-to-your-jira-instance'
    jira_username = 'username'
    jira_password = 'password'

    jira = JIRA(jira_url, basic_auth=(jira_username, jira_password))
  • Assuming you want to retrieve stories under the epic ABC-123
    epic_key = 'ABC-123'

    jql = f'"Epic Link" = {epic_key}'

    issues = jira.search_issues(jql, maxResults=False)

    for issue in issues:
    print(f'Key: {issue.key} - Summary: {issue.fields.summary}')

I hope this helps

Suggest an answer

Log in or Sign up to answer