I am working on Jira to snow integration and I am facing below challenges,Please help me out with these.
Field mapping : In order to map fields like Priority and Severity. We have different values in Jira and SNOW for these fields. I tried to map the values with below example but its not working:
Status Mapping: We have a requirement where we want to update the values of snow and Jira fields depending on issue status in Jira as described in sheet below. I tried something like this but I am not sure about syntax.
if (replica.status.name == âCanceledâ) {
if (replica.customFields.âCancellation Notesâ?.value == âCanceled by Clientâ) {
incident.customFields.âClose Codeâ?.value = âNot Solvedâ
}
}
if (replica.status.name == âresolvedâ) {
issue.customFields.âYourCustomFieldNameâ?.value = âvalueâ
}
Sync Panel In snow: I wanted to check with you that do we have a way to show jira issue link in snow ? the way we see it in sync status panel in jira.
Comments:
Francis Martens (Exalate) commented on 21 August 2020
> I tried to map the values with below example but its not working:
What is not working?
Anshuman Bakshi commented on 21 August 2020
When i am mapping priority values it is not syncing the values from SNOW to Jira. Also do you have any feedback on Status Mapping and Status Panel in SNOW.
Script error for issue INC1055058. Details: Cannot cast object â{display_value=Anshuman Bakshi, link=https://amdocsuat.service-now.com/api/now/v2/table/sys_user/90b87fcfdb43a34027c24980399619d7}â with class âscala.collection.convert.Wrappers$MapWrapperâ to class âcom.exalate.api.domain.hubobject.v1_2.IHubUserâ due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: com.exalate.api.domain.hubobject.v1_2.IHubUser(scala.collection.convert.Wrappers$MapWrapper). Error line: Script676.groovy:8
Comments:
Anshuman Bakshi commented on 25 August 2020
Francis Martens (Exalate) Any suggestion on this ?
Error: Script error for issue INC1055056. Details: No such property: remoteIssueUrl for class: Script429. Error line: Script429.groovy:8
Francis Martens (Exalate) commented on 21 August 2020
Ha - what is the version of your ServiceNow?
We introduced it recently
You can also use
// this should be at the top of the processor
import groovy.json.JsonSlurper
def remoteIssueUrl = new JsonSlurper().parseText(syncRequest.replica.payload).get("issueUrl")
Anshuman Bakshi commented on 21 August 2020
Not sure about the SNOW version as i am a Jira Admin.
i tried the above one in incoming sync of SNOW and gets: Script error for issue INC1055056. Details: Cannot set property âvalueâ on null object. Error line: Script456.groovy:14
// this should be at the top of the processor
import groovy.json.JsonSlurper
def remoteIssueUrl = new JsonSlurper().parseText(syncRequest.replica.payload).get(âissueUrlâ)
incident.customFields.âRelated Jira Defectâ.value = remoteIssueUrl
Francis Martens (Exalate) commented on 21 August 2020
incident.customFields.âRelated Jira Defectâ is null and cannot be dereferenced âŚ
Anshuman Bakshi commented on 24 August 2020
Hi Francis Martens (Exalate)
As we are syncing the value of âRelated Jira Defectâ field and it should get value using this remoteIssueUrl. I see issue is already existing on Jira side so can you tell me why we are getting null value.
Francis Martens (Exalate) commented on 26 August 2020
I am getting error and status sync is not working.
Script error for issue INC1055058. Details: Cannot cast object âCode Fix / Configuration Changeâ with class âjava.lang.Stringâ to class âcom.exalate.api.domain.hubobject.v1_2.IHubStatusâ. Error line: Script632.groovy:7
Francis Martens (Exalate) commented on 24 August 2020
Script error for issue INC1055058. Details: Cannot cast object 'Code Fix / Configuration Change' with class 'java.lang.String' to class 'com.exalate.api.domain.hubobject.v1_2.IHubStatus'. Error line: Script632.groovy:7
Is happening on the outgoing sync (on the servicenow side) ?
If this is the case, this is because replica.status is a status object while incident.state a string.
You can transfer the state using for instance