Automation. Leave a comment in the Linked stories

Arsen Sukias November 14, 2024

Hello!
In the first picture you see automation - when a version is released - close all version's tasks.

 

image.png

Versions contain only tasks and bugs. But the parent for a task is a story, of course this is implemented through "LinkedIssues", i.e. relates to, or the parent for.

I have been racking my brains for a long time how to make it so that when closing a task after a releasing, a comment with the date and name of the fixVersion is left in the parent story. What is the best way to do this?

 

 

image.png

2 answers

1 vote
Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 14, 2024

Hi @Arsen Sukias 

 

Your second part cannot work as For Linked Issues reference the Version released not the Task and you cannot have a branch action in a branch action.

You could create a second automation that add a comment to the parent when a Task is closed. Assuming your Tasks are all closed by this Release automation. Do not forget to check the option to let the second rule be trigger by an automation. 

 

To fetch the release info, you will have to get the fixVersion associated with the issue.

eg 

{{issue.fixVersions.first.releaseDate}}

 

Regards

0 votes
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.
November 14, 2024

Hi @Arsen Sukias -- Welcome to the Atlassian Community!

First a suggestion: I recommend adding a condition before transitioning the issues so they do not change / transition if they are already "closed".

Back to your question...

This could be done with one or two rules.  @Florian Bonniec describes the approach for doing this with two rules, where the actions of one rule trigger the other.  This may be better if you want the "parent" Story comment added after the associated Task is completed, and if you expect there could be more than 100 total issues updated.

For a one-rule approach...

  • rather than branching to the issues in the Fix Version, use the Lookup Issues action to gather those issues with JQL
  • save the keys in the lookup result in a variable as comma-separated values
  • use another Lookup Issues call, with dynamic JQL to find the linked Stories to any Tasks that were in the first lookup results; this will require using smart value, list filtering on the issue type
  • combine the first variable and the keys from the second lookup results into a final, dynamic JQL that spans all the issues
  • use a branch on JQL to update the issues in one pass

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer