Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Updating a field in destinationissue on ticket link trigger

Nik Rogul August 5, 2024

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:
image.png
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.

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2024

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

Nik Rogul August 7, 2024

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!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events