Originally asked by sapir monza on 28 August 2019 (original question)
Hi,
I’m using Exalate to sync between projects on the same Jira server instance.
Currently, the remote issue key is synced to a custom filed in the original ticket with the following code:
ExalateEventListener.hangListener(
connection,
{ String localIssueKey, String remoteIssueKey, localIssue, remoteIssue -> // operation when remote issue has been Exalated localIssue.customFields."Escalated ticket".value = remoteIssueKey }
,
{ String localIssueKey, String remoteIssueKey, localIssue, remoteIssue -> // operation when remote issue has been UnExalated }
,
{ String localIssueKey, String remoteIssueKey, localIssue, remoteIssue -> // operation when remote issue has been Deleted }
)
However, when the original ticket needs to be sync with 2 projects, only one of the remoteissue key is synced to that field - “Escalated ticket”.
How can make sure that those 2 cases will display in this field separated with a comma?
For example, the triggered fired and now the synchronization of the original ticket under project ‘z’ started with two different projects (project ‘x’ and project ‘y’), in “Escalated ticket” field under the original ticket in project ‘z’ I expected the two cases will be displayed on from project ‘x’ and the second on from project ‘y’.
Thanks,
Sapir
Comments:
Francis Martens (Exalate) commented on 28 August 2019
Hi Sapir,
I’m a bit lost on the structure of the code and the use case you want to implement
Can we take it step by step and confirm that the sequence below is correct - or rectify where possible
- Issue A1 gets exalated to create a twin B1
- Issue A1 gets exalated to create a twin C1
- With the ExalateEventListener.hangListener you are trying to update a customField “Escalated Ticket” such that it contains a link to B1 and C1
- Something fails
Could you add the complete script here or in a code-sharing service such as https://codepile.io
sapir monza commented on 29 August 2019
Hi Francis,
Correct, actually the process didn’t fail, both issues B1 and C1 linked to A1, but only one of them displayed under the “Escalated Ticket” field.
I got the script from Roman Melnychenko in case number EASE-2816, I have added all the following scripts to our Jira server under scripts folder:
and the code below to the Outgoing sync(data filter):
ExalateEventListener.hangListener(
connection,
{ String localIssueKey, String remoteIssueKey, localIssue, remoteIssue ->
// operation when remote issue has been Exalated
localIssue.customFields."Remote Issue Key".value = remoteIssueKey
},
{ String localIssueKey, String remoteIssueKey, localIssue, remoteIssue ->
// operation when remote issue has been UnExalated
},
{ String localIssueKey, String remoteIssueKey, localIssue, remoteIssue ->
// operation when remote issue has been Deleted
}
)
Please let me know if any clearification is needed.
Thanks!
Jorge Jerez Ibáñez commented on 22 February 2021
Hi
Are this files hiden now? I’ve a similar problem and can’t solve it