Trigger New Ticket based on CF value

Originally asked by M. Ashar Iqbal on 17 April 2023 (original question)


There is a custom field called ‘Supplier’ at Jira OnPrem side.

There are two Projects at jcloud side.

Ticket is always created and exalated from Jira OnPrem side.

If the Custom field value 01 is selected, then it should exalate a ticket for Project A

If the Custom field value 02 is selected, then it should exalate a ticket for Project B

Do not prefer to create more than one connection to comply with this use-case.


Answer by Charlie Schonken on 17 April 2023

provided you set a replica for ‘Supplier’ in the Jira OnPrem output script (example replica.supplier), you can in scripting for jcloud in the incoming script do an IF statement to specify the project key it must be created for.

if(replica.supplier?.value == '01') {
  // Exalate to Project A
  issue.projectKey   =  'PROJECTA';
} else if(replica.supplier?.value == '02') {
  // Exalate to Project B
  issue.projectKey   =  'PROJECTB';
}

There may be better ways, but that is how I currently do it.


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.