Forums

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

How to inspects other issues while the context is the current issue?

Pronto Software
Contributor
March 4, 2019

Hi,

I’m having trouble building automation for this scenario:

Task has five subtasks.

When three particular subtasks are Done – send the reporter an email.

 

Task

-subtask 1 DONE

-subtask 2 DONE

-subtask 3 DONE

-subtask 4

-subtask 5

 

It’s easy to get this to work for any one of the three subtasks, using JQL:

“type = "-subtask 1" AND resolution = Done OR type = "-subtask 2" AND resolution = Done OR type = "-subtask 3" AND resolution = Done”

 

but enforcing logic to check the three subtasks for Done is proving difficult. Is there a tricky combo of smart values in a query that shifts Automation for Jira so that it inspects other issues while the context is the current issue?

There is no pattern to the completion of subtasks. The subtasks could be marked as done at different times and by different users.

 

Any assistance would be appreciated.

Cheers,

Peter Quick

1 answer

1 accepted

0 votes
Answer accepted
John McKiernan
Atlassian Partner
March 4, 2019

Hey Peter,

yes this is definitely something you can do. 

Keep in mind, it would simple to do (using a related issues condition) if you didn't need the exact number of sub-tasks to be 3. 

Because of this necessity, you will need to add something to those sub-tasks that can be picked up by JQL (for example - a label) as I have done in my example below.

  • Trigger: When issue transitioned 
  • Branch rule: for parent
  • If JQL issues match - issues: parent = {{issue}} and label = <firstthreeonly>
  • and Status = Done
  • Action: Send email 

 

The screenshot below probably describes it best. 

 

Screenshot at Mar 05 12-16-46.png

I hope that helps but do let me know if you have any other questions.

Cheers,

John 

Pronto Software
Contributor
March 4, 2019

Hi  John,

Taking a break from the problem for a nice lunch resulted in headspace and another approach, which is very close to your suggestion.

 

I turned the workings around and had each subtask add a label to the parent on transition to Done (using JMWE add-on).

The Automation for Jira rule is triggered at the parent Task for an update to the labels field. Simple JQL checks parent Task for Labels = subtask1-done, subtask2-done, subtask3-done. If Yes, all three labels exist: send the email.

 

Thanks for responding with a good answer, I’m slowly picking up the use of smart values.

Cheers,

Pete Q

John McKiernan
Atlassian Partner
March 4, 2019

Hey Pete,

your lunch must have been a healthy one! That's a good solution. 

We have a webinar this week around Smart Values which is really useful to help advance your skills. You can register here: https://zoom.us/webinar/register/WN_7vg_oBqhQjWRvkWRi-xiSQ

Even if you can't attend, we will send you the recording if you have registered :)

Best of luck!

John 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events