# How jira and exalate sync

**URL:** <https://community.exalate.com/t/how-jira-and-exalate-sync/4480>\
**Category:** General Questions\
**Tags:** onpremise-jira, migrated\_question\
**Created:** [November 4, 2024, 7:00am UTC](https://community.exalate.com/t/how-jira-and-exalate-sync/4480 "2024-11-04T07:00:34Z")\
**Posts on this page:** 2\
**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:00am UTC](https://community.exalate.com/t/how-jira-and-exalate-sync/4480/1 "2024-11-04T07:00:34Z")

</div>

_Originally asked by redjeb on 30 November 2020 [(original question)](https://oldcommunity.exalate.com/questions/20122588)_

* * *

Hello,

We have a customer who created a Jira issue from servicenow with their own rest api call (not with exalate) , they want the Jira issue to be synchronised with the snow ticket, how can we achieve this ?

Which field is used to achieve the sync?

Best regards

* * *

---

<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:00am UTC](https://community.exalate.com/t/how-jira-and-exalate-sync/4480/2 "2024-11-04T07:00:35Z")

</div>

_Answer by Francis Martens (Exalate) on 30 November 2020_

What you will have to do is

a) Create a connection between ServiceNow and Jira

b) Create the logic to connect the ServiceNow entity with the Jira issue  
This can be done manually or via automation.

Via automation - example but YMMV

**Incoming Sync - Jira OnPrem - untested**

```auto
import com.atlassian.jira.component.ComponentAccessor

// replica.customKeys.TargetIssueKey is set on the other side with the target issue key ...

if (firstSync) {
   def targetIssueKey = replica.customKeys.TargetIssueKey
   // if the targetIssueKey is provided, connect with existing issue
   if (targetIssueKey) {
	   // look up the issue id (assuming you always get a hit which is of course utterly naive.

	   def jIssue = ComponentAccessor.getIssueManager().getIssueObject(targetIssueKey)
	   issue.id = jIssue.id
	   issue.key = targetIssueKey
   } else {
	   issue.summary = "..."
   }

}

```

Once that the issue is connected, any change will be synced

* * *
