Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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 pass variable in jql while using jira search api in python

Hello Team, 

 

I am using below search API to fetch jira issues:

 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-rest-api-3-search-get

 

let say value of the project and labels are variable then how can i pass in below jql query ?

 

project_name = 'DEVOPS'

label_name = 'alert_manager'

query = {
'jql': 'project = DEVOPS and labels = alert_manager and summary ~ "TargetResponseTime_5_Sec_For_2min" and status not in (Closed, Done)'
}

 

i want to pass project_name and label_name variable in above jql. how to pass ?

 

 

 

1 answer

1 accepted

0 votes
Answer accepted

String interpolation is what i was looking for. 

 

query = {
'jql': f'project = {project_name} and labels = {label} and summary ~ "TargetResponseTime_5_Sec_For_2min" and status not in (Closed, Done)'
}

 

Worked

 

thanks  

@Pankaj Kumar Pandey - I have the following line here for JQL i want to pass two parameters how can I achieve it ?

issues_in_project = jira.search_issues('status = "Pending QA Deployment" AND project = ALPHA', startAt=0, maxResults=2000, validate_query=True, fields=None, expand=None, json_result=None)

two parameters are status and project. Please let me know how to achieve this ?

Suggest an answer

Log in or Sign up to answer
TAGS

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