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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,321 views 14 20
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot