Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

What else can I do to prevent duplicates?

I have a Script Listener that "hears" Created and Updated events and creates either 1 or 2 sub-tasks depending on various conditions. The task creation is fine, but at least twice a week, the script creates duplicate issues.

I think this is happening because we have an integration to Salesforce (Go2Group CRM Plugin) which can cause an issue to be updated 2 times in a second, and therefore multiple instances of the listener may be running at once.

In the log, I can see that we are sometimes going straight from detecting 0 sub-tasks to detecting 4, so my guess is that sometimes, I'm trying to detect sub-tasks which exist but have not been indexed yet.

I tried calling the indexer in the script as I created each task, but saw no improvement in detection rate, so I removed that. Also tried re-declaring the sub-task collection later in the script, in case a few extra milliseconds might help, which really didn't.

What can I do to decrease the incidence of duplicates? 

Would it make sense to focus on indexer performance, or add something else to the script, or just sleep for a second or two before trying to check for tasks?

Here's how I'm looking for duplicates in the script, and thanks for any ideas you have!

...

Collection subTasks = parentIssue.getSubTaskObjects()
if (!subTasks.find{it.getSummary().contains "Incident"}) {
Blah blah }

 

1 answer

1 accepted

0 votes
Answer accepted

Hi April,

As blunt and simple it might sound but at least for testing purposes have you tried adding a post function to you sub task "Create" transition, which would fire a custom event. And then reconfigure your listener to listen to that custom event. If you place this post function LAST on your "Create" transition, then I think it should help you at least diagnose where your duplicates appear and best case scenario use this approach to get rid of duplicate listener launches all together.

Ivan, I think that helped!

After having that in place a few weeks now, duplicates are only happening when the other add-on fires 3+ updates in the same second, which is thankfully rare, and even then, I only get one dupe. 

Probably the only further improvement would be to improve indexing speed.

Thanks for the great idea!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase

The benefits of using Jira in different departments

Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...

109 views 0 7
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