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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

144 views 2 0
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