Raise a Jira ticket in a defined Project, depending on what Assignment group it was assigned to in ServiceNow

Originally asked by Jonathan Gilbert on 15 January 2021 (original question)


How/where do you configure the ability to create a Jira ticket in a defined Project, depending on which ServiceNow Assignment group it was assigned too.

Example:-

Ticket assigned in ServiceNow to “Group A” would raise a ticket in Jira under “project A”

If a ticket assigned in ServiceNow to “Group B” would raise a ticket in Jira under “project B”

If a ticket assigned in ServiceNow to “Group C” would raise a ticket in Jira under “project C”

etc…

At present to config of the connection was set “Single Project”, so think that may be the issue. The video advises you can change it later, but I dont know how you do that, or do I have to delete the connection and start again?


Answer by Francis Martens (Exalate) on 20 January 2021

Jonathan Gilbert

(For your information - there is no SLA from our side to answer questions as the support queue has priority)

Once that the connection is created, you can head over to the sync rule editor on the Jira side and add in the incoming sync script a mapping between the assignment group and the target project.

To fully grasp how to configure Exalate, you need to grasp that Exalate is a message processor, where on each end you define what information needs to be sent and on the other end how that information needs to be processed.

So for your use case - you make sure that the assignment group is added to the replica by adding something like

Outgoing sync - ServiceNow - Untested

replica.customKeys."assignment group" = incident.assignment_group

On the incoming side in Jira you specify how this needs to be processed

Incoming sync - Jira - Untested

def assignmentGroupMap = [
  // Assignment Group -> Project Key
    "Group A" : "PRJA",
    "Group B" : "PRJB",
    "Group C" : "PRJC", 
]

if (firstSync) {   
   // this is executed during the first sync
   // Look up the key in the mapping and if not found default to PRJA
  issue.projectKey = assignmentGroupMap[replica.customKeys."assignment group"] ?: "PRJA"

}

Note that developing this behaviour will require some experimentation.
Exalate has an extensive partner network of people who can help you go through this - check https://exalate.com/partners