How do I prevent looping in Insight Automation

markbutterfield January 11, 2022

For Insight Automation I am running a groovy script to update objects, how can I prevent the automation from looping? There is no functionality for suppressing facade events as far as I am aware of. Is there a way to use currentUser() in the IF of the automation if using a techUser for the "run as"?

1 answer

1 accepted

0 votes
Answer accepted
Peter-Dave Sheehan
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 12, 2022

You can limit looping by adding an "Idle Interval" parameter to the Action definition in the automation screen. You can try with 30s to prevent one event to fire generating a second one right within the next 30seconds. But this doesn't always work if you perform large bulk edits, the automation queue may be so large and take a long time to flush that the 30s will be long past by the time the automation is executed.

The other option is to instruct your script not to fire any events when it updates the object.

When you call the storeObjectBean() or storeObjectAttributeBean() methods, pass the following as a second argument: com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption.DO_NOT_DISPATCH

If you use the DO_NOT_DISPATCH method, you don't need to use the Idle Interval.

markbutterfield January 14, 2022

Yes, tried the idle already but not optimal. Thanks for the suggestion of adding the second arg....did not think of it as was not listed in the javadocs, but worked like a charm!!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events