Can REST aPI search endpoint return only issue ids?
I would like to query large sets of data, properties as key, expand,self drastically increase payload.
I would like to use search endpoint for determining user view permission for a large number of issues.
You can use the Jira expressions REST API to return whatever payload you want based on issues returned from a JQL query. For example, to return only IDs, make the following request:
"expression": "issues.map(i => i.id)",
"query": "your JQL query",
The response will be something like:
I would use /rest/api/2/search?jql=&maxResults=50&startAt=0&fields=issuekey
You will get following:
@kkercz I am wondering what would be more efficient. I was told that generating some columns can influence Jira performance (we are talking here about many requests in short time), therefore you should always add fields to search endpoint requesting only those you need. Now I am wondering whether using expression will be more performant. How expressions are executed internally? Will they be applied after jql results are generated or maybe some complicated logic is behind that and the results are generated faster with expression endpoint?
For this kind of use case, Jira expressions will be at least as fast, if not faster, than the JQL endpoint. Internally, only the issue IDs (or other requested fields) will be loaded from the database during the execution of the JQL query. We analyse the expression to figure out which issue fields need to be fetched.
How can I get more than 1000 of maxResults?
I’m afraid 1000 is the limit, both in the JQL and Jira expressions API.
In JQL it is not. I have successfully retrived 5k issues.
Oh, that’s good to know. I see now that the limit in JQL when searching only for ID or key is actually 10k. We should probably make it consistent and raise the limit to that level in the Jira expressions API. But for now unfortunately it’s only 1k in Jira expressions regardless of what your JQL is or what fields you are using.
When could you rise it to 10k?
I would appreciate it greatly.
Our benchmark is to verify issue view permission for 100k issue in less than 1s. If you could rise the limit to 10k I could meet the requirement with 10 concurrent threads.