How to Synchronize comments with author in RITM (Request Item) on ServiceNow?

Originally asked by Samanta Peixoto on 21 January 2023 (original question)


Hi,

I’m trying to get the author of Jira’s comment and comment to Service Now.

I used the script below for incidents and it worked, but for requests the error occurs: No such property: issue for class: Script485

//Comments
entity.comments = commentHelper.mergeComments(issue, replica,                      
                    {
                       comment ->
                       comment.body =
                          "[" + comment.author.displayName +
                                  "  | email: " + comment.author.email + "]" +
                                  " comentou: \n" +
                          comment.body + "\n" 
                    }
)

How to Synchronize comments with author in RITM (Request Item) on ServiceNow?


Answer by Jillani Fazal on 27 January 2023

Hi Samanta Peixoto

You can check this doc: https://docs.exalate.com/docs/how-to-sync-comments-in-servicenow

Also, you can try something like this first:

requestItem.comments += replica.addedComments

requestItem.comments += commentHelper.mergeComments(issue, replica,
{
comment ->
comment.body =
"[" + comment.author.displayName +
" | email: " + comment.author.email + "]" +
" comentou: \n" +
comment.body + "\n"
}
)

I hope you will find the shared information useful.

BR,

Jillani