Hello, I am making following REST API call to my JIRA instance.
Am getting the total result as 1, but am not getting any values inside the issues : [ ]
JQL:
http://myjira:8080/rest/api/2/search?startAt=1&maxResults=50&fields=project,status&jql=fields project status jql project=C00195 and key=C00195-2210
But I'm getting an error response:
{"startAt":1,"maxResults":50,"total":1,"issues":[]}
Above JQL is not working in browser as well.
If we remove the key filter then it was working as expected.
Working JQL:
http://myjira:8080/rest/api/2/search?startAt=1&maxResults=50&jql=project=C00095
Response:
{"expand":"schema,names","startAt":1,"maxResults":50,"total":2175,"issues":[{"expand":"operations,versionedRepresentations,editmeta,changelog,renderedFields","id":"12560","self":"http://myjira:8080/rest/api/2/issue/12560","key":"C00095-2215","fields":{"parent":{"id":"12559","key":"C00095-2214","self":"http://myjira:8080/rest/api/2/issue/12559","fields":{"summary":"Task for tagging testing","status":
I actually couldn't understand the first URL but it seems that you give an issue key (key=C00195-2210) in JQL? So, it will return a single issue as expected.
But for the second one, it returns all issues within a project as you give "project = C00095" in JQL.
Hi @Tansu Akdeniz,
Here key=C00195-2210, is the issueid or key.
I need to get status of particular issue in jira.
Thanks!
Bharathi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the following URL;
It is better to get data with that one (more efficient way)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Btw, if you want to get a query issues (JQL), use that one;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Tansu Akdeniz!
Given solution is working!
Just curious to know why below search query is not working?
JIRA_BASE_URL/rest/api/2/search?&fields=project,status&jql=key='C00195-2210'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are welcome @Bharathiraja S.
Actually, it seems same if I don't miss anything. Would you please mark as "Answered" (big grey tick mark to the left of the answer). So that, other people will be able to find this answer easily for similar questions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.