Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I prevent looping in Insight Automation

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

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.

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
Community showcase
Published in Apps & Integrations

Marketplace Partner Spotlight: Fine Software

Happy New Year, everybody! What better way to kick off 2022 than with a new Marketplace Partner Spotlight ✨ This month, we're getting to know Daniel Franz, co-founder of Fine Software. Fine Software ...

423 views 2 15
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you