Whenever you sync an issue from JIRA A to JIRA B, changes are high that the issue key on the remote issue is different from the local one (unless you implemented Is it possible to keep issuekey same on both sides?)
What you would like to achieve is that once that the JIRA A issue is exalated, you can store the remote issue key locally in a custom field 'Remote Issuekey'
For this solution you will require an add-on like Script Runner for JIra to capture Exalate events that JIRANode emits: these are events when an issue has been Exalated (but there are a couple others)
- Step 1: Customfield 'Remote Issuekey'
You create a 'Text field - read only' with the name 'Remote Issuekey' and ensure it is visible on the appropriate screens and contexts
- Step 2: Add a file 'ExalateListener.groovy' to your <jira-home>/scripts directory containing the script listener code below
- Step 3: You create a custom script listener as explained here
it should look like
- Step 4: Validate by exalating an issue and see that the customfield is updated
Script Listener code (script file version)
Script Listener code (Inline version)
For the inline version, you don't need to declare a class, nor define a customEvent method.
The code is
- How to sync an issue key to the summary name
- How to synchronize a comment, including remote issue key
- How to synchronize the original issue key to a custom field