# Incoming comments on ServiceNow issue

**URL:** <https://community.exalate.com/t/incoming-comments-on-servicenow-issue/5119>\
**Category:** General Questions\
**Tags:** exalate, servicenow, jira, migrated\_question\
**Created:** [November 4, 2024, 7:44am UTC](https://community.exalate.com/t/incoming-comments-on-servicenow-issue/5119 "2024-11-04T07:44:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 7:44am UTC](https://community.exalate.com/t/incoming-comments-on-servicenow-issue/5119/1 "2024-11-04T07:44:42Z")

</div>

_Originally asked by Harold Oconitrillo on 17 March 2022 [(original question)](https://oldcommunity.exalate.com/questions/42834946)_

* * *

I have finished a big part of the synchronization that we need for the Proof of Concept (actually everything that’s incoming to Jira from service-now). However, I am facing difficulties with the service-now incoming part. Particularly with comments. As an example of the problem, in attachment. What I am trying to do is to add a comment in Jira and for it to be synchronized in S-Now in the “Internal work notes” field. This is sort of happening, but it is not adding the latest comment only; it’s actually adding the full history of the comments each time.

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 7:44am UTC](https://community.exalate.com/t/incoming-comments-on-servicenow-issue/5119/2 "2024-11-04T07:44:42Z")

</div>

_Answer by Syed Majid Hassan on 23 March 2022_

Hi Harold,

I hope this finds you well and apologies for the slight tardiness in replying. In our call last week, you were able to articulate the requirements as follows:

- Any comments coming in from Jira should appear as Work Notes in ServiceNow
- Any changes made to the Summary (and other fields) on Jira after the first sync, should not reflect in the corresponding field on ServiceNow side, but should rather log a comment showing this change as a Work Note.

I was able to achieve the above with the following configuration:

```auto
if(firstSync){
    //Decide on the first sync, which entity you want to create based on the remote issue type
    entity.tableName = "incident"
    entity.short_description = replica.summary
}
if(entity.tableName == "incident") { 
    entity.description = replica.description
    entity.attachments += replica.addedAttachments
    if(!firstSync && previous?.summary != replica.summary){
       issue.comments = commentHelper.addComment("New description is now: " + replica.summary, false, issue.comments)
    }
    
    issue.comments = commentHelper.mergeComments(issue, replica, {it.internal = true})
}  

```

A more detailed explanation of how this was done is contained in the following video:

[Jira to SNOW Work Notes.mp4](https://oldcommunity.exalate.com/download/attachments/42834946/Jira%20to%20SNOW%20Work%20Notes.mp4?version=1&modificationDate=1648057197339&api=v2)_(old community)_

Many thanks

Majid

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 7:44am UTC](https://community.exalate.com/t/incoming-comments-on-servicenow-issue/5119/3 "2024-11-04T07:44:43Z")

</div>

_Answer by Eileen Reimers on 17 March 2022_

Hi

I haven´t found your problem 100% but the way how to add always the current comment is described in this documentation:

[https://docs.idalko.com/exalate/display/ED/How+to+synchronize+comments](https://docs.idalko.com/exalate/display/ED/How+to+synchronize+comments)

Hopefully this will help you

Regards, Eileen

* * *
