Originally asked by Jose Lobo on 23 September 2020 (original question)
What is the best way to sync Jira “assigned to” field and “assignment groups” in ServiceNow
Originally asked by Jose Lobo on 23 September 2020 (original question)
What is the best way to sync Jira “assigned to” field and “assignment groups” in ServiceNow
Answer by André Leroy-Beaulieu Castro on 23 September 2020
Hi!
To synchronize ServiceNow Assignment Groups to Jira Assignees bi-directionally, you will need to create a mapping between assignment groups and corresponding users in Jira, for example:
Jira Outgoing Sync:
replica.assignee = issue.assignee
Jira Incoming Sync:
def assigneeMapping = ["Assignment Group A":"jirauser@example.com",
"Assignment Group B":"jirauser2@example.com"]
issue.assignee = nodeHelper.getUserByEmail(assigneeMapping[replica.assignment_group])
ServiceNow Outgoing Sync:
if(incident.assignment_group && incident.assignment_group != "")){
replica.assignment_group = incident.assignment_group?.displayValue
}
ServiceNow Incoming Sync:
def assignmentGroupMapping = ["jirauser@example.com":"Assignment Group A",
"jirauser2@example.com":"Assignment Group B"]
def localAssignmentGroup = assignmentGroupMapping[replica.assignee?.email]
incident.assignment_group = nodeHelper.getReference("assignment_group", "name", localAssignmentGroup)
Thanks,
André
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.