# Setting up incoming Jira from Service Now RITM's

**URL:** <https://community.exalate.com/t/setting-up-incoming-jira-from-service-now-ritms/6255>\
**Category:** General Questions\
**Tags:** snow, servicenow-jira, jira, ritm\
**Created:** [March 18, 2025, 3:34pm UTC](https://community.exalate.com/t/setting-up-incoming-jira-from-service-now-ritms/6255 "2025-03-18T15:34:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbrooks](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@cbrooks](https://community.exalate.com/u/cbrooks)\
**Post date:** [March 18, 2025, 3:34pm UTC](https://community.exalate.com/t/setting-up-incoming-jira-from-service-now-ritms/6255/1 "2025-03-18T15:34:35Z")

</div>

I am struggling to set-up the incoming script on the Jira side when sending Service Now RITM’s.

 ![image](https://europe1.discourse-cdn.com/flex018/uploads/exalate1/original/1X/0ff75e2a5813c55d380d956c6ee5a595beebe030.png)

Is the following correct??

requestItem.summary = replica.summary  
requestItem.description = replica.description  
requestItem.customFields.“MyIT Ticket”.value = replica.key  
requestItem.comments += replica.addedComments

FULL SCRIPT:

if (firstSync) {  
issue.projectKey = “DTT”  
// Set the same issue type as the source issue. If not found, set a default.  
replica.issueTypeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: “Request”  
}

if(replica.issueTypeName == “Request”) { // if the received issue typeName is Improvement create Request Item on ServiceNow

```auto
requestItem.short_description = replica.summary
requestItem.summary = replica.summary
requestItem.description = replica.description
requestItem.customFields."MyIT Ticket".value = replica.key
requestItem.comments += replica.addedComments

requestItem.comments = commentHelper.mergeComments(requestItem, replica)
requestItem.attachments += replica.addedAttachments

```

}

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

Or should I be using a different syntax?

Many thanks in advance.

---

<div class="post-metadata">

**Author:** ![Majid](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/majid/32/343_2.png) [@Majid](https://community.exalate.com/u/Majid)\
**Post date:** [March 19, 2025, 6:16pm UTC](https://community.exalate.com/t/setting-up-incoming-jira-from-service-now-ritms/6255/2 "2025-03-19T18:16:56Z")

</div>

Hi,

I wasn’t quite sure where this is failing for you, so included a quick video here:

[![](https://europe1.discourse-cdn.com/flex018/uploads/exalate1/original/1X/937c332146d2e66678b2784b1eb9e2bc6b9d6344.jpeg "RITM between SNOW and Jira") ](https://www.youtube.com/watch?v=y-LTyaFakFI)

These are the scripts in my case:

**SNOW Outgoing:**

```
if(entity.tableName == "sc_req_item") {
    replica.type_name = "sc_req_item"
    replica.key = entity.key
    replica.summary = entity.short_description
    replica.description = entity.description
    replica.comments = entity.comments
    replica.state = entity.state
    replica.attachments = entity.attachments
    replica.number = entity.number
}

```

**SNOW Incoming:**

```
if (firstSync) {
// For the first sync: Decide the entity you want to create based on the remote issue type
entity.tableName = "“sc_req_item”"
}

if (entity.tableName == "sc_req_item") {
    entity.short_description = replica.summary
    entity.description = replica.description
    entity.attachments += replica.addedAttachments
    entity.comments += replica.addedComments
}
// Sync any other entity using the table name and the entity variable
if (entity.tableName == "cmdb_ci_business_app") {
    entity.short_description = replica.summary
    entity.description = replica.description
}

```

**Jira Outgoing**  
No change to default scripts

**Jira Incoming**

```
if (firstSync) {
    issue.projectKey = "CM"
    // Set the same issue type as the source issue. If not found, set a default.
    issue.typeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task"
}
issue.summary = replica.summary
issue.description = replica.description
issue.comments = commentHelper.mergeComments(issue, replica)
issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
issue.labels = replica.labels

```

Hope it helps!

Thanks  
Majid

---

<div class="post-metadata">

**Author:** ![cbrooks](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@cbrooks](https://community.exalate.com/u/cbrooks)\
**Post date:** [March 21, 2025, 11:56am UTC](https://community.exalate.com/t/setting-up-incoming-jira-from-service-now-ritms/6255/3 "2025-03-21T11:56:18Z")

</div>

Many thanks for this Majid

Looking at some of your documentation, I was under the understanding that I had to use the prefix of “requestItem” for the Jira incoming script rather than “issue”. This makes a lot more sense now.

---

<div class="post-metadata">

**Author:** ![Majid](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/majid/32/343_2.png) [@Majid](https://community.exalate.com/u/Majid)\
**Post date:** [March 21, 2025, 12:44pm UTC](https://community.exalate.com/t/setting-up-incoming-jira-from-service-now-ritms/6255/4 "2025-03-21T12:44:34Z")

</div>

Indeed. We will get the documentation amended as well, but I am curious to check if this actually solved the issue bi-directionally for you.

@Javier can you please take the documentation piece from here on in.

Thanks

---

<div class="post-metadata">

**Author:** ![cbrooks](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@cbrooks](https://community.exalate.com/u/cbrooks)\
**Post date:** [March 25, 2025, 3:32pm UTC](https://community.exalate.com/t/setting-up-incoming-jira-from-service-now-ritms/6255/5 "2025-03-25T15:32:10Z")

</div>

Hi Majid  
Yes, I have successfully set-up the initial bi-directional flow based on your update. I now have a new query regarding RITM variables which I will raise a new question on.

Many thanks again for your assistance and help on this.

---

<div class="post-metadata">

**Author:** ![Majid](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/majid/32/343_2.png) [@Majid](https://community.exalate.com/u/Majid)\
**Post date:** [March 25, 2025, 3:33pm UTC](https://community.exalate.com/t/setting-up-incoming-jira-from-service-now-ritms/6255/6 "2025-03-25T15:33:54Z")

</div>

Glad to hear that!  
Thanks

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/system/32/3_2.png) [@system](https://community.exalate.com/u/system)\
**Post date:** [March 26, 2025, 3:34pm UTC](https://community.exalate.com/t/setting-up-incoming-jira-from-service-now-ritms/6255/7 "2025-03-26T15:34:53Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
