How to Sync SNOW fields "Item" with "Story Name" & "Requested For" with Reporter in Jirath Jira fileds

Originally asked by Anshuman Bakshi on 30 September 2020 (original question)


We want to sync fields Requested For & Item from SNOW to Jira. Both of these fields are of Reference type.

Please have a look on Sync rules from Jira and SNOW:
SNOW Outgoing:

//Requested for
def link = catalogTask.u_requested_for?.link
def parsedlink = (link =~ /.\/(.)/)
def user

if (parsedlink.matches())

{ user = nodeHelper.getReference("sys_user","sc_req_item","sys_id",parsedlink[0][1]) }

replica.customKeys.reporter = user?.name
}

Jira Incoming:

issue.reporter = nodeHelper.getUser(replica.customKeys.reporter?.name) ?: exalate

Error Message:

Script error details: No such property: exalate for class: Script115. Error line: Script115.groovy:36

Answer by Juan Grases on 17 November 2020

The error is rather related with line:

issue.reporter = nodeHelper.getUser(replica.customKeys.reporter?.name) ?: exalate

Where you are using a non declared variable exalate . You probably want to remove that default case or get an actual use using:

issue.reporter = nodeHelper.getUser(replica.customKeys.reporter?.name) ?: nodeHelper.getUserByEmail("default@exalate.com")

Using the right default email.