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

issue in getting jql count in jira using python code

Srimathi Kannan March 15, 2024

Hi, 
I have used below code to get issue count for jql in jira by using python program

resp_json = jira.search_issues(real_jql, fields="*all",\
                                               expand=expand,\
                                               json_result=True,\
                                               startAt=start_idx,\
                                               maxResults=incr_idx,
                                               validate_query=True)


i could able to see there is no problem in connecting with jira also when i run the jql in jira manually i am getting the issue tickets. Only issue is the count is not returning from search issues. It always coming as 0.

1 answer

0 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 25, 2024

Hi @Srimathi Kannan and welcome,

what is your jql? You need to put your jql in quotes example 'project=TEST'

Hope this helps,

Fabio

 

Srimathi Kannan March 27, 2024

Hi Fabio, 

Thanks for your response

we will first convert the jql from confluence page table to json format. so my jql will appear like given below

"jql": "component in subfolder(xxx, yyy) and type = bug and Status != Closed and 'Validation team' is not EMPTY"
I got response from jira.search_issues when i try with my own assigned ticket number but not with above jql. But i got confirmation from my management side that there is no specific access for this project it is common for all
when i try as you suggested with single quotes i got value expected bug statement
Note: As i previously mentioned when i check manually the above jql is working and getting issue tickets from jira
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 27, 2024

please could you try this parameter?

"component in subfolder(xxx, yyy) and type = bug and Status != Closed and \"Validation team\" is not EMPTY"

Srimathi Kannan March 27, 2024

"component in subfolder(xxx, yyy) and type = bug and Status != Closed and \"Validation team\" is not EMPTY" - if i give slashes \ i am getting error Fabio
with slashes we cannot able to retrieve from jira manually as well. it is showing invalid jql sign

as i said with my ticket number i am able to get response from jira

but for jql i am not getting the response. also confirmed no access issue for this jira connectivity. 

could you please let me know is there any other method to solve this issue?
like instead of jira.search_issue what other methods can be used to retrieve the count by running the jql in jira

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events