Forums

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

JQL using JIRA API in Python

Harshita G
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!
April 10, 2023

Hi I am trying write a JQL using the API in python to get the data from the tickets from a particular board, I want to add date variables so that we can get the data for user entered dates. I am new to using the API so unable to figure out how to do this. I will be grateful for any help, Thanks in advance. I tried using the following which is giving me error -:

 

project_issues_specific = jira_instance.get_all_project_issues(project="MED", fields=["description", "summary"])

 

the above is working but giving me the first 1000 when the board was created, I also tried 

 

jira_instance_1 = jira_instance.jql(project = "PROJ1" AND "Epic Link" = EPIC-123 AND issuetype = Story ORDER BY priority DESC, updated DESC)

 

jql_query = project = MED AND issuetype in (Task,Story) AND "Epic Link" = "MED-098" AND updated >="-6M"

 

both of these are giving me syntax errors.

1 answer

1 accepted

0 votes
Answer accepted
Jared Kells
Contributor
April 11, 2023

I think the JQL should be in a string and I don't see any quotes around them, is it a python syntax error?

Something like "project = \"PROJ1\" AND \"Epic Link\" = EPIC-123 AND issuetype = Story ORDER BY priority DESC, updated DESC"

I could be misunderstanding but hope that helps!

Harshita G
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!
April 14, 2023 edited

Thanks Jared, yes it was a syntax error, thanks for helping me out. 

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, mindful member, mindful member badge, atlassian community, community kudos, community giveaway, atlassian swag, community values, empathy and kindness, badge challenge, atlassian learning, community engagement, swag giveaway

Earn a Badge, Win a Prize 🎁

Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!

Start here
AUG Leaders

Atlassian Community Events