How does rest/api/2/issue/picker works? Edited

I'am confused about the results which I get from the API call, and can't imagine any suggestions how the results correlate with the input params.

For example, lets take the following endpoint: 

rest/api/2/issue/picker?query=PRJ-&currentJQL=project != ""

I assume that the result should contains all the issues where the key starts from "PRJ-" and the project is not empty.

But what I get is first of all are two sections - Current Search and History search. What are this sections? I was unable to find any usefull information about how this sections are populated and for what purposes they are used. Sometimes one section could be absent, another time they could be totally equal.

Second thing - the 'sub' property of section usually tells me that it is showing 19 matching issues out of 40. But I can't get another 21 issues.

Also, if the query parameter of API method is a JQL expression, then how it can search through uncompleted issue key?

I would be very grateful if someone could provide a small completed quide how this endpoint works and for what purposes it should be used.

1 answer

Hello Noah,

I am answering bit late, but we have recently used this endpoint in our project and had similar questions, when trying to figure out, how it is working. Because someone could have same problems in future, I'll write answer here.

Endpoint returns two sections "History search" and "Current search".

"History search" is returned every time and contains only issues, that are related to user logged user (user is assignee on this issues, reporter, visited them recently etc.) and fits the query. For example new Jira user, that have freshly logged in, won't have any issue in this section.

"Current search" seems to be based on JQL query. It is only retrieved when the "currentJQL" is specified in your request. (Sometimes it seemed to apply the JQL filter from Jira issue search).

Our hack, to retrieve all issues for issue picker, was to send empty string "" in "currentJQL" field and our search string in "query" field.

Hope it helps a bit.

 

Thank you for your answer!

I also hope that it will help in the future for other API users.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

26,198 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you