Check out this snipper that updates a bunch of issues' customfields:
for (issue in parentsIssue) { issue.update { setCustomFieldValue('xx', issue.getCustomFieldValue('yt').toDouble().round(1).toString()) setCustomFieldValue('xc', issue.getCustomFieldValue('yy').toDouble().round(1).toString()) setCustomFieldValue('xv', issue.getCustomFieldValue('yu').toDouble().round(1).toString()) setCustomFieldValue('xb', issue.getCustomFieldValue('yi').toDouble().round(1).toString()) setCustomFieldValue('xs', remaining_ce.round(1)?.toString()) setCustomFieldValue('xd', remaining_ef.round(1)?.toString()) setCustomFieldValue('xa', remaining_eg.round(1)?.toString()) setCustomFieldValue('xy', remaining_xx.round(1)?.toString()) } }
What causes the script to run? Is it part of a Behavior, a Script Listener? Automation rule?
When I'm updating issues like this, I typically do it in a Script Listener where I'll set the values and then run the following to update and re-index the issue. I've never had a problem with these updates taking a noticeable amount of time.
The "update" block should commit all the changes back to the database at once in a single transaction.
I would check that you don't have automations or other listeners that are then firing and delaying the execution of the subsequent loop.
It looks like you're new here. Sign in or register to get started.