Hello,
I would like to create a script listener.
In the start of the code, I would like to put a condition that sends true only if the specific event was updating the 'fix version' system field.
How can I find the type of the event= which field was updated and triggered this script listener.
Thanks for your help :)
Hello @Dan27
You could find event type via evenTypeManager
Here is example:
import com.atlassian.jira.component.ComponentAccessor
def eventTypeManager = ComponentAccessor.getEventTypeManager()
def eventTypeName = eventTypeManager.getEventType(event.eventTypeId).getName()
log.error("EVENT TYPE NAME --> "+ eventTypeName)
Hi @Mark Markov , Thanks!
The output is
Issue Updated
I would like to get the field that was updated, in my case- 'Fix Version'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Than you ll need to listen for field changes on issue_updated event, not events itself
Here is example
def change = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == "Fix Version"}
if (change) {
log.error "Value changed from ${change.oldstring} to ${change.newstring}"
// your actions if the field has changed
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.