Hello!
I am trying to build an automation that is triggered when tickets a linked.
The rule should go over all the children of an issue, take the logged hours of each child, and add them to a custom field in a link destination issue.
I.e. aggregate the work hours of trigger issue and its children to a custom field in destination issue.
I am trying to find how can I reference the custom field in the destination issue in order to perform the operation.
This is what I have now:
So inside the branch I can see the value of created variable with the work hours, and I can see the destinationissue custom field, but the big question how do I add the variable value to the custom field in the destination issue?
The regular "edit issue" command works on the current issue from the branch and has no option to select another issue.
I tried to do a lookup for the destination issue, but it turned out that lookupissues variable does not work with custom field.
Thank you.
Hi @Nik Rogul -- Welcome to the Atlassian Community!
A created variable cannot be accumulated that way. And even if it could, the variable would not be available outside of the branch.
(Branches which could be on more than one thing are run in separate processes, and the variables created inside vanish once the branch is done...And, the branch likely would not finish before the other rule steps complete.)
Instead...
I believe you need to invert the logic a bit. Use the Lookup Issues action with JQL to gather the child issues, use that to sum the smart value needed:
{{lookupIssues.timetracking.timeSpentSeconds.sum}}
Then branch to your destination (or other issue) to update the field(s) needed.
Kind regards,
Bill
Bill, it worked.
I was asware that variable values cannot be changed once created and that branch runs as threads, so I was hoping I will be able to update the custom field in the destination issue in the branch, but did not know how to address it.
But your solution is elegant and works.
Thanks a lot!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.