Looking for a way to overcome lookupissue 100 tickets limitation

Gilad Waldman
Contributor
January 1, 2025

Hello,

Trying to run calculation on initiatives child issues (going over each epic children and combining all the child issues to determine SP progress). For initatives with less than a 100 tickets - the loopupissue works great, but for bigger ones im left with no solution.

Was thinking to use REST API to query jira with JQL (Something like: 

parent in portfolioChildIssuesOf({{issue.parent.key}}) and "story points" > 0 )

Thought about this one : 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-jql-match-post but it requires list of ticket IDs and i cant provide that upfront.

any ideas? or a better approch? 

thanks

3 answers

2 accepted

1 vote
Answer accepted
Gilad Waldman
Contributor
January 2, 2025

For future refernce, I started with a webhook step using REST API approximate-count call to deternmine how many tickets are under the initiative. 

Then, started to run lookupissue step chunks based on the the number of tickets i have in total, note that you will need to order the tickets to make sure you keep the alignment. I used this : 

parent in portfolioChildIssuesOf({{issue.parent.key}}) and "story points" > 0 ORDER BY key ASC

 

Now, when i know how many tickets i have i saved {{myKey}} varaible per @Benjamin suggestion : 

{{if(equals(lookupIssues.size, 0), "outOfScopeKey", lookupIssues.last.key)}}

(As I am breaking the flow to chunks, all you need is actually just lookupIssues.last.key)

 

And now all is left is to calculate the Done SP and the total SP. if number of tickets is higher than 100, you should run, save the results under a variable and run again with the limitation of <{{myKey}}.

 

0 votes
Answer accepted
Benjamin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 1, 2025

HI @Gilad Waldman ,

 

There isn't a direct way that I have seen. This post may provide another option for you.

 

https://community.atlassian.com/t5/Jira-Service-Management/Enabling-pagination-over-100-issues-in-the-Jira-Lookup-Issues/m-p/2685990#M5492

 

Hope it helps.

Gilad Waldman
Contributor
January 2, 2025

Thank you @Benjamin 

This is a good approch for me, but I have just one last question - I created Else-If rule that based on the number of tickets this initiative holds, run the flow, but i cant find a way to count the number of tickets this initiative holds.

Any recommendation here?

Gilad Waldman
Contributor
January 2, 2025

Used this REST API call - /rest/api/3/search/approximate-count and solved. 

Thank you @Benjamin 

1 vote
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.
January 1, 2025

Hi @Gilad Waldman 

Short answer: the only ways I know to do this with the REST API or an automation rule is divide-and-conquer, such as sum first at the Epic level and then sum the Epics.  You could also build your own app to page through repeated calls to the REST API endpoints.

 

More information...

The 100 issue limit is from the REST API endpoints, which automation rule actions such as Lookup Issues rely upon.  There are new bulk-get search REST API endpoints to get up to 5000 issue id values: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-jql-get  But as soon as fields other than the id are added to the results, the 100 issue limit applies.

 

And so one possible workaround is to first sum the values at the Epic level (assuming they have 100 child issues, or fewer) and then sum to the Initiative level by summing the Epics.  This approach requires multiple automation rules with different triggers / conditions to avoid running into other service limits, such as looped execution:

  • rules for child Story, Task, etc. to Epic
    • when Story Points change in a Story which has a parent, update the parent for all children
    • when a Story is created which has a parent, update the parent
    • when the parent of a Story is removed, update the previous parent
    • when the parent of a Story is added, update the new parent
    • when the parent of a Story is changed, update both parents (special case of the two above)
    • when a Story with a parent is deleted from Jira, update the previous parent
    • when the sum field in the Epic is changed manually, recalculate it from the child issues
  • rules for Epics to Initiative
    • please see above for similar cases, with some slight variation to allow the update of an Epic to trigger a rule to update Initiative, using the rule option "Allow rule trigger..."

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events