The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Listener on Create issue & changing custom field

aas
Contributor
July 3, 2019

Hello. I need to catch events:

1) when custom field changed;

2) I need to catch event when issue is created and custom field changed.

For first condition there's no problem I catch this like this 

def change = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {(it.field.toString() == "fieldName")}

 but I don't know how to catch changing of the custom field while creation of issue.

I will be glad to any help.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Antoine Berry
Community Champion
July 4, 2019

Hi @aas , Welcome to the community ! 

To my knowledge you cannot. If you actually check issue history, fields valued in the create transitions are not displayed because you can just check them directly on the issue.

As a result you cannot catch a change of the field value. So you would have to retrieve its value and compare it to the default value to know if the user has changed it.

Antoine

aas
Contributor
July 4, 2019

Thank you Antoine. I solved that problem making another script and adding it as a post function script. And add that post function to 'create' transition.

Antoine Berry
Community Champion
July 4, 2019

In that case you could use a Listener or a Post-function with the same result, but a post-function is a wiser logical choice I do agree.