Error integrating reference field assignment group for new INC from Jira to SN

Originally asked by Andrew on 16 December 2020 (original question)


Hello,

I’ve got following error while sending new INC from Jira to be created in ServicNow:

Script error details: No signature of method: services.node.hubobjects.NodeHelper.getReference() is applicable for argument types: (String, String, com.exalate.basic.domain.hubobject.v1.BasicHubOption) values: [assignment_group, name, com.exalate.basic.domain.hubobject.v1.BasicHubOption@b319ba65] Possible solutions: getReference(java.lang.String, java.lang.String, java.lang.String). Error line: Script30.groovy:28

Outgoing script in Jira is here:

replica.customFields."11410" = issue.customFields."11410"

Incoming rule in SN looks as here:

def remoteAssignmentGroup = replica.customFields."11410"?.value  
incident.assignment_group = nodeHelper.getReference("assignment_group", "name", remoteAssignmentGroup)?.sys_id

and payload from Jira to SN here:

"11410": {
        "id": 11410,
        "name": "Assignment Group",
        "type": "OPTION",
        "value": {
          "id": 11958,
          "sequence": 71,
          "value": "HLC-F-FIS",
          "disabled": false,
          "childOptions": []
        }

Answer by Andrew on 15 March 2021

Right configuration:

def remoteAssignmentGroup = replica.customFields."11410"?.value?.value  
incident.assignment_group = nodeHelper.getReference("sys_user_group", "name", remoteAssignmentGroup)?.sys_id

Answer by Francis Martens (Exalate) on 16 December 2020

def remoteAssignmentGroup = replica.customFields."11410"?.value

remoteAssignmentGroup is a hubOption (com.exalate.basic.domain.hubobject.v1.BasicHubOption@b319ba65]

You will need to get the value out of it by doing

def remoteAssignmentGroup = replica.customFields."11410"?.value?.value

Give it a try


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.