Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Compilation of Smart Values within Linked Tasks

Bryan Harmon (Lost Boys) July 21, 2023

Hello there!  I'm attempting to compile a list on a top-level task and running into an issue with automation.

For context, this top level task has several linked tasks, each with a Smart Value "Patch Note." 

My goal with the automation flow is when its transitioned to an In Progress state, it enumerates through each linked task and compiles a list of Patch Notes from each linked task.

The issue I'm encountering is that I'm unable to access the latest comment of the root top-level task via any Smart Value I've tried to edit it with the compiled list of notes.

comment layout.png

I've tried using {{triggerIssue.comments.last.id}}, but this yields "No comment to edit."

 

Thanks in advance for any information you can provide.

2 answers

1 vote
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.
July 21, 2023

Hi Bryan,

Looking at the image of the rule you posted in the question, I wonder if it works as you expected regarding created variables: are you expecting that created variable to be updated and usable after the branch? If so, please note...

  1. Branches on one-and-only-one-thing (e.g., branch on current issue, parent, etc.) get run in-line, as if the branch did not exist / alter the flow.
  2. All other branches which could-be-more-than-one-thing (e.g., branch on JQL, linked issues, etc.) are run asynchronously and in parallel.  Issue updates work, as expected, and persist.  Other things which happen in the branch stay in there, and go out of scope afterwards.  And...there is no guarantee of when the branch will complete...up to the very last step of the rule itself.

What this means for your apparent rule is that a variable created inside of a branch of type #2 will go out of scope with each loop.  The results are not preserved and carried forward for each loop...or after the branch completes.

The same is true for branches of type #1, with a special exception if a variable is created before the branch and recreated inside with the same name, the value is updated.  For example:

  • ...
  • action: create variable with name varMyVariableName and some value
  • branch: on current issue (or another type#1 branch
    • ... 
    • action: create variable with the same name varMyVariableName and some updated value (shadowing the old value)
    • ..
  • ...after the branch, the updated value of varMyVariableName is available

 

Kind regards,
Bill

0 votes
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 21, 2023

Hi @Bryan Harmon (Lost Boys) -

Wouldn't editing the top-level task's latest comment possibly be a problem if somebody had come along and made a comment on that task?

I would just add the list of patches as a new comment.

I believe your rule could be much simpler if you do something like this:

Screenshot 2023-07-21 at 10.03.00 AM.png

I basically copied the work from John here: https://community.atlassian.com/t5/Jira-Software-questions/Automation-How-comment-linkedIssues/qaq-p/1555922#M112511

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 21, 2023

Whoops, reread your original post - you'd want to change the trigger to when it transitions to "In Progress".

Bryan Harmon (Lost Boys) July 21, 2023

It's not shown in the screenshot (it's above) but the trigger is for In-Progress and the automation is creating the comment in question so thankfully I don't have to worry about a user editing it in the meantime!

I'll give it a shot and mark as Answered as soon as I'm done. Thank you!

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 21, 2023

Ahhhh, ok that makes a lot more sense.

Yeah, let me know how it goes.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events