def impactMapping = [
// Jira issue impact <-> SNOW incident impact
"1 - High" : "1 - High",
"2 - Medium" : "2 - Medium",
"3 - Low" : "3 - Low"
]
def defaultImpact = "3 - Low"
def impactName = impactMapping[replica.customFields."11406"?.name] ?: defaultImpact // set default impact in case the proper impact could not be found
incident.impact = nodeHelper.getImpact(impactName) //It is line 54 mentioned below
But now is a sync error:
Script error for issue INC0010770.
Details: No signature of method: services.node.hubobjects.NodeHelper.getImpact()
is applicable for argument types: (String) values: [3 - Low]
Possible solutions: getAt(java.lang.String), getProject(java.lang.String).
Error line: Script815.groovy:54
Comments:
Levente Bedő commented on 25 April 2023
@Andrew you can check the script I’ve shared, it may work for you too.
We’re working with Jira cloud, and we found two custom fields there, Urgency and Impact. We added these to the screen of the project we wanted to sync (check if it’s there already, it may be depending on the Jira flavour you are using for your project).
Since Exalate has deprecated setting the priority directly, we need to set these two values to get an ITIL conform prio.
Please note, that these Jira fields use a 4 value choice instead of the expected 3 value choice, so you must compromise and do the matching yourself (you can replace entity with incident in the script if you have to).
Our Jira works as a master instance, we don’t change these values in SN, so you will have to write these scripts yourself based on the ones I’m providing here, if you need a two-directional sync of these field values.
SN incoming
// Urgency sync
def urgencyMapping = [
// Jira issue urgency <-> Snow incident urgency
"High":"1 - High",
"Critical":"1 - High",
"Medium":"2 - Medium",
"Low":"3 - Low"
]
def defaultUrgency = "3 - Low"
def urgencyName = urgencyMapping[replica.urgency.value] ?: defaultUrgency // set default urgency in case the proper urgency could not be found
entity.urgencyValue = urgencyName
// Impact sync
def impactMapping = [
// Jira issue impact <-> SNOW incident impact
"1 - Critical":"1 - High",
"2 - High":"1 - High",
"3 - Medium":"2 - Medium",
"4 - Low":"3 - Low"
]
def defaultImpact = "3 - Low"
def impactName = impactMapping[replica.impact.value] ?: defaultImpact // set default impact in case the proper impact could not be found
entity.impact = impactName