Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JMWE PostFunctions: Iterating through more than 100 issues

Ahmad Sidawi
Contributor
September 7, 2021

Hello, 

I'm wondering if its possible to create more than 100 issues through post functions. I know that Jira 'paginates' queries to only return 100 issues at a time, so I'm trying to figure out how to keep calling the next 100 issues. The 'startAt' variable didn't do what it does when performing automations through Python, it instead only starts value in the first 100. Here's what I've got now:

 

image.png

{% for i in range(1,(("project = X  and issuetype = Task order by updated desc")|searchIssues(maxResults =100, startAt=0) | length)) %}

{{i}},

{% endfor %}

What I want to do is keep calling the next 100 issues according to that query :).

 

Any help appreciated, I could do this through Python but would prefer to keep it instant on transition and within Jira :).

1 answer

1 vote
David Fischer
Community Champion
September 7, 2021

Actually, the limit of "searchIssues" is now 1000, not 100. However, you won't be able to create 1000 issues in a single Create Issue(s) post-function because you'll reach the execution time limit (5 minutes) of that post-function.

Ahmad Sidawi
Contributor
September 8, 2021

Nice, the update to searchIssues addresses that first problem. 

Is there any way to override that timeout? Or should we split the post function?

David Fischer
Community Champion
September 8, 2021

No, the timeout cannot be extended. The solution is to split the issue creation into multiple issues.

And you should be able to use the startAt parameter 

Suggest an answer

Log in or Sign up to answer