# How do I sync links from Jira "relates to" to ADO "Related"

**URL:** <https://community.exalate.com/t/how-do-i-sync-links-from-jira-relates-to-to-ado-related/5196>\
**Category:** General Questions\
**Tags:** exalate, link, issuelink, issulink, linking\
**Created:** [November 4, 2024, 7:49am UTC](https://community.exalate.com/t/how-do-i-sync-links-from-jira-relates-to-to-ado-related/5196 "2024-11-04T07:49:12Z")\
**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:49am UTC](https://community.exalate.com/t/how-do-i-sync-links-from-jira-relates-to-to-ado-related/5196/1 "2024-11-04T07:49:12Z")

</div>

_Originally asked by Tomás O’Flaherty on 05 May 2022 [(original question)](https://oldcommunity.exalate.com/questions/42837621)_

* * *

I have many links that I want to maintain between Jira issues and their synced ADO counterparts.

One is the “implements”/“implemented by” link in Jira which translates to “Parent”/“Child” in ADO for us. This I can do on the ADO side via the ‘syncHelper.getLocalIssueKeyFromRemoteId’ call and the ‘workItem.parentId =’ assignment

Another is “relates to”/“related by” link in Jira which translates to “Related”/“Related” in ADO for us. The problem is I dont know how to set this in ADO.

- Does ADO support sending something like replica.issuelinks = workItem.Links?

- Can I set a link in ADO via something like this workItem.Links += createLink(FromWorkItem, ToWorkItem, LinkType)?

* * *

#### Comments:

> **Tomás O'Flaherty commented on 06 May 2022**
>
> > As an update  
> > I am able to use some Jira packages to create links. These are
> 
> ```auto
> import com.atlassian.jira.issue.link.IssueLinkManager;
> import com.atlassian.jira.component.ComponentAccessor;
> import com.atlassian.jira.security.JiraAuthenticationContext
> 
> ```
> 
> This allows me to use
> 
> ```auto
> def otherIssue = "ABC-1"
> def issue1 = ComponentAccessor.issueManager.getIssueByCurrentKey(issue.key)
> def issue2 = ComponentAccessor.issueManager.getIssueByCurrentKey(otherIssue)
> def user = authContext.getLoggedInUser();
> issueLinkManager.createIssueLink( issue1.getId(), issue2.getId(), Long.parseLong(LinkType), Long.valueOf(1), user)
> 
> ```
> 
> However the following fails when I want to set the otherIssue
> 
> ```auto
> def parentId = replica.parentId 
> def localParent = syncHelper.getLocalIssueKeyFromRemoteId(replica.parentId.toLong())
> 
> ```
> 
> This comes from the doco
> 
> [https://docs.idalko.com/exalate/display/ED/getLocalIssueKeyFromRemoteId](https://docs.idalko.com/exalate/display/ED/getLocalIssueKeyFromRemoteId)
> 
> On the sync helper page its associated with both Jira and ADO but it wont work on the Jira incoming sync _(but does work on the ADO incoming sync)_
> 
> [https://docs.idalko.com/exalate/display/ED/syncHelper](https://docs.idalko.com/exalate/display/ED/syncHelper)

---

<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:49am UTC](https://community.exalate.com/t/how-do-i-sync-links-from-jira-relates-to-to-ado-related/5196/2 "2024-11-04T07:49:13Z")

</div>

_Answer by Serhiy Onyshchenko on 22 May 2022_

Hello, Tomás O’Flaherty , well done looking at the methods there.  
Might I ask you to share the error you are getting when using this method on ADO?  
In case, if it doesn’t generate any error, is the linked issue synced with the same connection?  
Regards, Serhiy.

* * *
