Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Using set of issues as a search scope for JQL in Java API

Nik July 2, 2015

I my JIRA plugin I need to filter a set of issues by specific JQL and I am looking for a best way to do it using Java API.

For example: I want to check what issues from set IS-i1, IS-i2, IS-i3,..IS-iN satisfy some condition 'CONDITION'.

At the moment I am doing this by writing the following JQL: (issuekey = IS-i1 OR issuekey = IS-i2 OR ... OR issuekey = IS-iN) and (CONDITION).

I am feeling that my way is wrong. Could you please suggest a better way?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 2, 2015

You can use in:

issuekey in ("IS-i1", "IS-i2", ...)

or if you set is continuous it's better to use less and greater conditions:

issuekey >= "IS-i1" and issuekey <= "IS-iN"
Nik July 2, 2015

Thanks! I've already updated my code using your first suggestion. Is there a way to limit search scope programmatically?

Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 2, 2015

I do not know what do you mean by the "search scope". If you speak about pagination, you should use PageFilter: https://docs.atlassian.com/jira/latest/com/atlassian/jira/web/bean/PagerFilter.html. Samle code here: https://confluence.atlassian.com/display/JIRA/__Searching+in+JIRA - replace PagerFilter.getUnlimitedFilter() with appropriate method or constructor.

TAGS
AUG Leaders

Atlassian Community Events