Epic link removal doesn't sync

Originally asked by Richard K on 04 September 2023 (original question)


Hi,

we synchronise 2 Jira cloud instances with script. As we wanted to sync epics we set up our connections according to this article: https://docs.exalate.com/docs/how-to-sync-epics-in-jira-cloud
We use Epic.send() and Epic.receive() .

Adding epic link on a story works fine, but the removal of the epic link doesnā€™t.

Is there any solution for this?

Thank you.

Richard


Answer by Christophe De Beule on 16 October 2023

Hi Richard K,

My apologies on the delayed response.
To remove the epic link you can just set the value to ā€˜nullā€™ in the incoming script.
You first want to check if the replica is empty and that your issue still has the link, you can do something like this to check it.

if (!firstSync && (replica.customKeys."Epic Link" == null && issue."Epic Link" != null)){
   // Removes Epic link when replica.customKeys."Epic Link" is null and the local issue still has it's epic link
  // To make sure you use the right field you can check it within the entity sync status.
   issue."Epic Link" = null
}

I hope this answers your question.

Kind regards,
Christophe De Beule


Answer by Richard K on 17 October 2023

Hi Christophe,

in your solution ā€œEpic Linkā€ is the field on right side of the issueā€™s view screen (like ont the printscreen below)?

Does your script needs to define first ā€œEpic Linkā€ field in the script?
Like this:
Outgoing: replica.customFields.ā€œEpic Linkā€ = issue.customFields.ā€œEpic Linkā€

Incoming: issue.customFields.ā€œEpic Linkā€.value = replica.customFields.ā€œEpic Linkā€.value

Or do I have to do something with Epic.send() and Epic.receive() ?

Best regards,

Richard


Comments:

Christophe De Beule commented on 17 October 2023

Hi Richard K,

With the Epic.send() & Epic.receive() function you will keep the child parent relation if the child is sent over.
You donā€™t need to send the ā€œEpic linkā€ fields separate.

You donā€™t need to define the ā€œEpic linkā€ field first Epic.send() and Epic.receive() will take care of it.

I hope this helps.

Kind regards,

Christophe De Beule

Richard K commented on 17 October 2023

Hi Christophe,

it works great! (old community)

Thank you for your help.

Best regards,

Richard

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.