Sync ServiceNow work notes to Jira SD comments

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


When sending out incident SN work notes to Jira comments (replica.comments = incident.work_notes), got following error:

Cannot cast object '2020-12-01 10:15:25 - John Doe (Work notes) New text ’ with class ‘java.lang.String’ to class ‘java.util.List’. Error line: Script684.groovy:13


Answer by Juan Grases on 09 December 2020

When dealing with comments in exalate, you should only use the comments field:

replica.comments = incident.comments.findAll{it.internal}

To only send internal comments (worknotes)