To add a specific “Related work item” (i.e., an issue link) during synchronization in Exalate for Jira, you should use the standard approach for syncing issue links in your sync rules. Your current code snippet is close, but Exalate expects you to work with the issueLinks property, not outwardLinks directly.
This will add the “realize” relationship to the specified issue key. Make sure that the link type (“realize”) matches exactly with the link type configured in your Jira instance.
A few important notes:
The property to use is issue.issueLinks, not outwardLinks.
If you want to sync all links from the source, you can simply assign:
issue.issueLinks = replica.issueLinks
If you want to merge with existing links, use the code above to append.
If you want more advanced control (like mapping link types or preventing overwrites), Exalate also provides an external script approach. See: IssueLinks.groovy
This should help you add related work items as part of your sync!
Any news on this? Kind of annoying that I have to wait several days for answers and support is closing my ticket. When looking for new customers everybody is helping immediately and afterwards you are on your own.
I’ve tested this between two Jira cloud instances.
In this Incoming Sync snippet, a REST API call is used to create an issue link in Jira Cloud during the first sync.
import com.exalate.basic.domain.hubobject.v1.BasicHubIssueLink.IssueLinkType //add this line at the very beginning of Incoming Sync rule
if (firstSync)
store(issue)
httpClient.post(“/rest/api/3/issueLink”, new groovy.json.JsonBuilder([
type: [ name: “Relates” ],
inwardIssue: [ key: “TP-168” ],
outwardIssue: [ key: issue.key ]
]).toString())
It links the synced issue (issue.key) to a specific issue (TP-168) with the link type “Relates”.
So, whenever a new issue is synchronized, Jira automatically creates that relationship.
If this isn’t the linking behavior you’re trying to achieve, I’d be happy to arrange a quick call to understand your exact use case, and then provide a suitable solution here in this post.