Initializer executed multiple times when updating issue

Hi,

When I edit and update an issue, the initializer is ran multiple times. It is not convenient as I conditionnally display a warning message. The initializer is us usually around 5 times (sometimes less, sometimes more, seems random). As as result, the message appears multiple times and covers a large part of the screen.

This is my code :

int cfId = 12345
def customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField cfObject = customFieldManager.getCustomFieldObject(cfId)
def cfValue = underlyingIssue.getCustomFieldValue(cfObject)

if (cfValue = "Custom Value triggering message"){
UserMessageUtil.warning("This incident has been created by a VIP")
}

Is there a way to execute the initializer only once ?

Thanks.

1 answer

Hi Antoine.

You are experiencing a form of the bug:

https://productsupport.adaptavist.com/browse/SRJIRA-2027

We're sorry for your troubles, if you watch this ticket you'll be able to know when it gets fixed.

Cheers!

Dyelamos

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Fadoua M. Boualem
Published 2 hours ago in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

200 views 3 4
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you