How to run a trigger on created issues only

Originally asked by Roman on 27 March 2020 (original question)


For example we have a Trigger

project = TEST AND assignee = Admin

We would like to run a synchronization only if the issue in the project TEST gets assigned to an admin user by creation. In case an old issue gets updated from assignee user1 to assignee admin Trigger should not start the synchronization


Answer by Roman on 27 March 2020

this can be achieved by adding the following code to the beginning of your Outgoing Sync

if(firstSync && (!eventTypeId || eventTypeId != com.atlassian.jira.event.type.EventType.ISSUE_CREATED_ID)) 
return;
This will work in Exalate version 4.7.4 and higher