Forums

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

Automation - Linked Issue to Approve after 2 or more Issues are Approved

Jesse Ortega Jr
Contributor
April 22, 2022

Hello. I have created the below automation rule to APPROVE a linked issue after an issue is transitioned to DONE/SUCCESSFUL. This works as expected. However, I want to modify the rule to APPROVE the linked issue after 2 or more issues are transitioned to DONE/SUCCESSFUL and I do not see how to do this. Is this possible? With the current automation in place, if an issue is blocked by 3 tickets, the blocked by ticket will APPROVE after 1 ticket is completed and it should not APPROVE until all linked tickets are DONE/SUCCESSFUL. 

Screenshot 2022-04-22 082907.png

1 answer

2 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.
April 22, 2022

Hi @Jesse Ortega Jr 

Perhaps consider using a Lookup Issues action with JQL rather than the branch: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues

Once you have identified the linked issues you may check the resulting count that match your criteria with an advanced issue condition to check {{lookupIssues.size|0}}

 

Kind regards,
Bill

Jesse Ortega Jr
Contributor
April 26, 2022

Hello @Bill Sheboy - I have taken a look at the suggestion that you recommended but I still do not see how to do this if it is possible. Below is a Lucidchart to help illustrate what I am trying to achieve. Tasks 1, 2, & 3 need to be DONE and with the resolution of Successful in order for task 4 to be approved. 

Screenshot 2022-04-26 085108.png

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.
April 26, 2022

Let's confirm your use case, cover a solution approach, and then note alternate use cases.

Your rule and diagram indicate the use case is:

  • Given there are 4 tasks (note: your rule seems to indicate these are sub-tasks issue types, but I will keep calling them "task" for consistency)
  • And 3 of them are linked as blocking the 4th one
  • When all 3 of them are in a status of Done with a resolution of Successful
  • Then the 4th one should be edited to Approve

For a solution approach...Whenever a task transitions to done, you can check if the conditions are met to approve the 4th one using JQL.

TODO: How do you know what the 4th task is?  Once you know that task, use the advanced JQL linkedIssues() function and substitute in your project name and the key to check if the other three are ready:

project = myProjectName AND issue IN linkedIssues(myKeyOf4thIssue, "is blocked by") AND status = Done AND resolution = Successful

In a rule, you may use that JQL with a Lookup Issues action to return the first 3 tasks, and then use an advanced compare condition to confirm the count is 3:

  • first value: {{lookupIssues.size|0}}
  • condition: equals
  • second value: 3

And, proceed with the edit if the condition is met.

 

For alternate use cases, if your number of tasks (e.g. 4 tasks) was just an example, your rule would need to account for that.  If the identify of the "4th task" is somehow dynamic, that may make your rule more complicate or perhaps even not possible.

Jesse Ortega Jr
Contributor
April 27, 2022

Thanks Bill. I will give this a try and let know how it works out. 

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer