In order to save time, it would be great if I could only sync the parent task and in case sub-tasks are created inside, they are automatically sync to the destination Jira.
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)
}
This should ensure that all subtasks get exalated when the parent issue is exalated. Of course also make sure that on the receiving side, you are properly syncing subtasks issues. Check this guide:
Instead of doing by outgoing, is it possible to trigger by rules?
I tried this solution, it worked, but every story will be sync when in outgoing sync.
but my trigger set the epic with jql for creating the sync, not all the issues would be auto sync
Comments:
Juan Grases commented on 14 March 2020
Hi!
With that approach every subtask of the parent task that was catch by the trigger will be synced, you still control which Parent task will be synced from the exalate trigger (which uses JQL).
If you also need to control which subtasks will be synced inside a parent task that was catch by the trigger, you can do it from the outgoing sync:
Outgoing sync
// Top of your outgoing sync
if(issue.type.name == "Sub-task" && issue.priority?.name == "Low"){
return ; //You will ignore sub-tasks which priority is Low
}
Of course this is just an example, you could set any condition to decide when a subtask (or any issue) will be synced or not.