Sync children along with their parent

Originally asked by Henry on 24 February 2020 (original question)


My requirement is quite simple, I want to sync the children when their parent is updated to status “B”, even if the children themselves aren’t updated to status “B”.

I need this because when my boss moves a parent ticket on his board, he wants to see it synced to another board, and he also wants to see its children tickets along with it.


Answer by André Leroy-Beaulieu Castro on 24 February 2020

Hi Henry,

We actually have a very convenient way of doing what you’re looking for in Jira Cloud, you can add the following to your Outgoing sync:

httpClient.get("/rest/api/3/issue/"+issueKey.id).fields.subtasks?.collect{
    def subTaskKey = new com.exalate.basic.domain.BasicIssueKey(it.id, it.key)
   syncHelper.exalate(subTaskKey)
} 
  

so if the parent is synced, it will look for it’s sub-tasks and sync them as well

Best regards,

André


[Failed to download attachment: attachment_11338214_smile.png. Error: 401 Client Error: for url: https://support.idalko.com/images/icons/emoticons/smile.png]

Comments:

Henry commented on 06 March 2020

Hi André,

Will this trigger the connected ones?

Example.

  1. Parent ticket P has one child C1
  2. update P, trigger the code above, sync C1 to destination board, named “C1-sync-first”
  3. Add new child C2 to P
  4. update P, trigger the code above, sync C2 to destination board, named “C2-sync”
  5. Will C1 be sync again to the destination board, named “C1-sync-again”?
  6. If so, what does “C1-sync-first” connect to?