Forums

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

Jira script Listener: handling events

Muhammad Bajwa September 14, 2018

Hi Everyone,

I have set up a script that I run on create and update of an issue, I have it set up so it compares the old and new value of a few fields to figure out if the scripts should be run (has the field changed).

The issue I am having is that now it only runs on an update, it does not run on a create issue event.

This is what I want to do:

if(fieldA_Changed || eventIsCreate) {

     blah blah

}

I am not sure how I can check to see if the event type is a create event, not an update event.

anyone familiar with this?

 

Thanks!

 

1 answer

0 votes
Muhammad Bajwa September 17, 2018

I was able to figure this out, I used event.getEventTypeId() to get the event type Id and check for it.

def eventTypeId = event.getEventTypeId()

if (eventTypeId == 3) { //3 is for create Issue, 2 is for update issue

   //do stuff

}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events