Missed Team ’24? Catch up on announcements here.

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

Enabling pagination over 100 issues in the Jira Lookup Issues Action

Benjamin Baker April 30, 2024

I figured out you can get around the 100-issue limit in the Jira automation Lookup Issues action by leveraging the {{lookupIssues.last}} value, specifically in this example lookupIssues.last.key but I imagine this could be adapted for other fields.

1. Do your JQL query in the Lookup Issues action.

2. Do whatever you want with the first 100 results.

3. Create variable action, call it myKey, set it to: {{if(equals(lookupIssues.size, 0), "outOfScopeKey", lookupIssues.last.key)}}.  The placeholder outOfScopeKey is something you know won't return anything from the next JQL lookup. For example, if you're filtering for issues created in the last day, use a key you know is older than a day. If the lookup issues size is 0, the conditional logic will return the out-of-scope key, if anything else, will return the last key. 

4. Repeat the JQL search, but add "and key < {{myKey}}".  This will get up to the next 100 issues if there are over 100 issues in the first call and will return nothing otherwise.

This process can then be repeated as many times as you want!

1 comment

Bill Sheboy
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.
April 30, 2024

Hi @Benjamin Baker 

I am glad to learn you found a workaround for your scenario, and...

That approach will work when the following conditions apply:

  • The JQL statement has an ORDER BY statement, allowing the use of the last issue's data in the next query.  In your case, the sort would be Key; probably ORDER BY Key DESC based on what you describe.
  • The actions performed by the branch on the issues must:
    • not impact the results of the JQL query
    • not be order dependent, as the branch(es) will execute in parallel and asynchronously
  • There is a maximum, known number of "chunks" of 100 issues needed, and it fits within the 65 component rule limit

 

There are other workarounds for this scenario, such as self-triggering rules with webhooks.  All workaround approaches for this limit have pros / cons, and so please confirm which works for you.  Thanks!

 

Kind regards,
Bill

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events