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 ?
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
@[deleted]- 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 ?
Hi @rithwik_poleneni
This works for me.
status = "'Pending QA Deployment'"
project = "ALPHA"
issues_in_proj = jira.search_issues('project=%s and status =%s' % (project,status), startAt=0, maxResults=2000, validate_query=True, fields=None, expand=None, json_result=None)
It looks like you're new here. Sign in or register to get started.