Hi,
I am trying to copy custom field from parent (Epic) to child (Story, Task). When using Jira automation, it is getting Throttled as the number of children retrieved are more than limit. I have split the query, but still exceeding the limit.
I am new to Scriptrunner. Can someone help me how to achieve above using Scriptrunner Query? If there is a reference, please send me the link. I am using Jira cloud premium license. Thanks.
Also, this is One time update I am trying to execute in a project. I have a jira automation rule setup to run when issue is created/updated going forward.
Hope you doing well!
You mentioned that the automation rule was throttled, which means the automation execution limit has been exceeded.
In the Jira Premium subscription, you are allowed 1,000 rule executions per user, per month.
Your automation rule is currently set to run every 5 minutes, which quickly consumes the available execution quota.
Best Regards,
Vishnu Vardhan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishnu, it is just a testrun in my sandbox and configured 5 min for a quick test. After that I disabled it. But I see jira limitations in processing. If jira has limitations are there any other options?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Nelson Nittala
Can you show us the Automation Rule you tried to use?
Which limit are you exceeding with the Automation Rule?
To get the child issues:
- Are you using a JQL in a Scheduled trigger?
- Are you using a Lookup Issues actions?
- Are you using a Branch For Child Issues?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using JQL in a scheduled trigger to retrieve all EPICS and updating custom field on Story and Task children.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How many child issues does each Epic have? Are there other type of child issues per Epic besides Story and Task?
The limit on branching for issues is 150. I see that you have a condition within the branch to limit the change to Task and Story type issues. You could incorporate that into the Branch to reduce the number of issues being retrieved for the branch:
Use a Related Issues / JQL branch instead of a Related Issues / Children branch.
Are you trying to overwrite content, or fill a currently blank field, or both? If you are trying only to fill blank fields then you could add that the the JQL criteria to further reduce the number of issues retrieved in the branch.
Since you say you also have a rule to handle this copy for newly created issues, you could add that to the above JQL criteria also to exclude issues with a Created value newer than the date that other rule was enabled.
Will that reduce the child issues per Epic to 150 or less?
How many Epics are you processing?
There is another overall limit to the number of issues a rule can fetch and the limit is 5000. That would be the number of Epics fetched in the trigger plus the total number of child issues retrieve in the branch for each Epic.
You could also add a label to each Epic after the branch to indicate processing for that Epic is done, and then incorporate the absence of that label into the JQL in your trigger for selecting Epics.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are around 600 epics and children of those epics are 5000 plus. I see there is threshold how many items can be retrieved. Even if I narrow down the search to just Story or Task, I believe it takes the total number of children.
I see limitations on - Max number of work items that can be retrieved per search (1000), Total allowed associated items per rule (5000), and also Max allowed processing time (3600 sec in 12hrs).
I am trying to narrow down with labels/created dates on epic and give a shot. But what is the best option if you have to update large amount of data?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With that large of a number of issues to update I think you are better off considering scripting.
You said you are new to ScriptRunner, and asked about a ScriptRunner Query to help you. A ScriptRunner Query is not going to solve the problem of hitting the Automation limits. I believe this is going to require actual scripting.
Do you have any familiarity with writing code in any language?
ScriptRunner has lots of examples of portions of scripts. You would have to piece them together.
https://docs.adaptavist.com/sr4jc/latest/hapi
Alternately a script could be written in a separate IDE (powershell, python, ...) that would use the Jira REST API directly to accomplish your requirement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have any scripting experience with any language?
After looking at the documentation from ScriptRunner do you think you could figure it out?
Or are you asking for somebody to provide you with the entire solution?
You could create and execute a ScriptRunner script from the Script Console.
https://docs.adaptavist.com/sr4jc/latest/features/script-console
The HAPI link I provided before provides several examples of ScriptRunner code that you can piece together. For instance, here is an example of how to run a JQL to select issues and update the issues found.
https://docs.adaptavist.com/sr4jc/latest/hapi/work-with-issues#run-jql-queries-to-search-for-issues
And information about getting values from fields:
https://docs.adaptavist.com/sr4jc/latest/hapi/update-fields#read-the-value-of-custom-fields
In your case you would need code to run a JQL to retrieve the epics. Rather than immediately doing the update, though, you need to get the field value from the Epic that you want to copy to its child issues. And then you need nest within it another search to get the child issues for the each epic.
Search for Epics -> For each Epic found
grab the value to be copied from the Epic
Search for child issues of the epic -> for each child issue found
Update child issue with the value previously grabbed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.