I want to make it so that once all 8 linked tasks are closed, then for the primary linked ticket: The assignee is set back to the reported. The status is set to closed. It automatically adds a comment to the original ticket
These are automation rules that I tried to accomplish this, I know I'm off track here. Any commentary is appreciated.
(Other issue types are the primary ticket, any linked item is a task issue type)
Hi @Sierra Lindamood -- Welcome to the Atlassian Community!
Would you please clarify your scenario? Is it one of these:
The first one can be solved using the Related Issues Condition, although I find that one a bit unpredictable in results / behavior. Instead, try using the Lookup Work Items action with a JQL expression to find the linked Tasks for better control over the logic.
The second one cannot be easily solved with automation rules due to how branches work, although it is possible when there is a specific known number of linked work items.
Kind regards,
Bill
Hi @Bill Sheboy
It's 1.) GIVEN a work item, which has 8 other Tasks linked to it, and WHEN all 8 Tasks are closed THEN I need that work item to be auto closed, assignee set back to reporter, add my custom comment.
Would my Lookup Work Items action with the JQL expression need to essentially say Any Issue Type that has Task Type Linked Items and ALL Linked Items are closed...THEN....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sierra Lindamood -- No, you could use the JQL needed to select only your specific ones. For example:
project = yourProject
AND issue IN linkedIssues("{{triggerIssue.key}}")
AND issueType = Task
AND statusCategory != Done
Please note the JQL inverts the condition to check for any not completed ones, and then tests that the count found is 0.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it to be expected that the JQL cannot be validated? When I put this jql in a regular search this part below, gives me this message:
("{{triggerIssue.key}}")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Correct: when using smart values to create a dynamic JQL expression, that cannot be validated by the rule.
Instead, it is a good idea to test the JQL outside the rule with an example work item to confirm it works as expected.
And...With my suggestion, your rule would not use the branch as the lookup and condition take the place of that logic to test the linked work items:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To test on just one work item, let's say the key is LOCAL-4571, what would you say is the best way to test this rule for just against that one? 1. Make sure all of the Tasks are Closed and the main ticket Opened, then ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To test, you could change the Scheduled Trigger's JQL to only return one work item with:
key = LOCAL-4571
And, please re-read what I posted as the rule would use a Lookup Work Items action in order to use the {{lookupIssues}} smart value. It would not use the JQL condition as you show.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much, learned a lot here and had success. @Bill Sheboy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn that helped!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm
When do you want the rules to be executed : when the last subtask is closed ? Or doing a hourly check is enough ?
your first automation runs when there is a transition to Open or Reopen. It should be Done (or whatever closing status your are using)
What is your selection criteria on the scheduled automation ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What needs to happen is when the last linked item is closed, that then closes the primary ticket that all of the linked items are connected by.
The scheduled aspect was a way I thought I may have to do it, to have the system check that all the linked items are closed to then trigger the rest of what needs accomplished.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.