Possible that JIRA Events are lacking?

I'm trying to update a custom field ("Field B") based on the value of another custom field ("Field A"). "Field A" can change as soon as the work starts, so "Field B" must be updated accordingly. 

My thought was to create a custom listener and hook that one up to the "Issue Created" and "Issue Updated" event, so that the listener can react on the field changes. In general the script and listener is working BUT it seems that the listener is always one event behind.

Lets say I update issues with key "TP-1" and "TP-2", the listner is only processing "TP-1", "TP-2" is only processed when I edit "TP-3" and so on and so forth.. 

Here is a simplified version of the script I'm using:

@JiraAgileBean
CustomFieldManager customFieldManager

def currentEvent = event as IssueEvent

def currentIssue = currentEvent.getIssue()

def idCustomFieldA = 11601L

def customFieldA = currentIssue.getCustomFieldValue(customFieldManager.getCustomFieldObject(idCustomFieldA))

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,770 views 18 21
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