4 answers
- 10-1
Hi Francis Martens (Exalate) ,
I am also trying to map reporter in jira with caller id field in SNOW,
Outgoing Sync:
replica.reporter = incident.caller_id
Incoming Sync:
issue.reporter = nodeHelper.getUserByUsername(replica.reporter?.username)
Output:
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
- Anshuman Bakshi
Francis Martens (Exalate) Any suggestion on this ?
Add your comment... - 10-1
> Sync status panel
Nope there is no such thing, but you can create a custom field in service now and then copy the remote issue url there
Check How to display the remote issue link in a custom field for more details
- Anshuman Bakshi
I created a URl custom field in SNOW and followed the document and it gives me this error.
Incoming Script on SNOW side: I tried with both names:
incident.customFields."Related Jira Defect".value = remoteIssueUrl
incident.customFields."u_related_jiradefect".value = remoteIssueUrl
Error: Script error for issue INC1055056. Details: No such property: remoteIssueUrl for class: Script429. Error line: Script429.groovy:8
- Francis Martens (Exalate)
Ha - what is the version of your ServiceNow?
We introduced it recentlyYou 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
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.JsonSlurperdef remoteIssueUrl = new JsonSlurper().parseText(syncRequest.replica.payload).get("issueUrl")
incident.customFields."Related Jira Defect".value = remoteIssueUrl - Francis Martens (Exalate)
incident.customFields."Related Jira Defect" is null and cannot be dereferenced ...
- Anshuman Bakshi
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)
> incident.customFields."Related Jira Defect".value = remoteIssueUrl
You have to use the right servicenow customfield name
Check the post below to find out the name
Add your comment... - 10-1
Regarding the priority mapping
> When i am mapping priority values it is not syncing the values from SNOW to Jira.Are the values available on the replica (check remote issues tab)
Check the 'Debugging Sync scripts on Exalate' to see whats going on and rectify
Add your comment... - 10-1
Regarding
if (replica.status.name == "Canceled") { if (replica.customFields."Cancellation Notes"?.value == "Canceled by Client") { incident.customFields."Close Code"?.value = "Not Solved" }
Are you sure about the name of the customField?
You can find out about the name by popping up the dictionary (right click)In more recent versions of the Exalate we provide shortcuts.
Normally you should be able to use incident.estimated_delivery.value ...
Let me know how it goes- Anshuman Bakshi
So i tried to set a basic status mapping following exalate documentation: https://docs.idalko.com/exalate/display/ED/Status+synchronization+on+Jira+Server#StatussynchronizationonJiraServer-statusSyncExternal
Outgoing Sync(SNOW):
replica.status = incident.state
Incoming Sync: (Jira)
// ["remote status name": "local status name"]
def statusMap = ["Active": "New", "Closed": "Done", "Code Fix/Configuration Change": "Development"]
def remoteStatusName = replica.status
issue.setStatus(statusMap[remoteStatusName] ?: remoteStatusName)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)
https://docs.idalko.com/exalate/display/ED/Status+synchronization+on+Jira+Server#StatussynchronizationonJiraServer-statusSyncExternal
Is about Jira Server syncScript 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 instancereplica.customKeys.state = incident.state
...
- Anshuman Bakshi
Thanks Francis, This is working fine now !
Add your comment...
State Mapping.xlsx
Hi Everyone,
I am working on Jira to snow integration and I am facing below challenges,Please help me out with these.
Map<String, String> priorityMapping = ["1 - High": "High", "1 - Critical": "Critical"]
if (replica.priority.name in priorityMapping.keySet()) {
def priority = nodeHelper.getPriority(priorityMapping[replica.priority.name])
issue.setPriority(priority)
}
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"
}
> I tried to map the values with below example but its not working:
What is not working?
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.