Try to sync Additional comments but it create Work notes

Originally asked by Ariel Aguilar on 20 October 2021 (original question)


Question by client:

I try to sync text field from jira to Additional comments on Service Now but the comment created as Work notes and not as Additional comments.

my script is:
if((previous.customFields.“SNOW Comments”?.value!=replica.customFields.“SNOW Comments”?.value) && replica.customFields.“SNOW Comments”?.value){
def comment = new BasicHubComment()
comment.setBody(replica.customFields.“SNOW Comments”?.value)
incident.addedComments += comment


Answer by Yael on 20 October 2021

TNX
it’s work :smile:


Answer by Ariel Aguilar on 20 October 2021

Please try the following:

if((previous.customFields."SNOW Comments"?.value!=replica.customFields."SNOW Comments"?.value) && replica.customFields."SNOW Comments"?.value){
def comment = new BasicHubComment()
comment.setBody(replica.customFields."SNOW Comments"?.value)
comment.setInternal(false) 
incident.addedComments += comment
}

Kind regards,

Ariel