Close specific subtask using automation

CoreyM April 24, 2024

I have read several of the posts regarding the use of post script functions and automation to close issues and subtasks, but have not found any documentation on how to close a specific subtask if certain criteria is met. We have several workflows that have multiple subtasks created by default and on occasion it is necessary to close a subtask is specific criteria is met. Is this possible using JIRA automation?

3 answers

1 accepted

1 vote
Answer accepted
Laurie Sciutti
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 24, 2024

Hey @CoreyM ~ if I understand correctly, you will want a Rule triggered on update of the Sales sub-task, with a JQL Branch Rule similar to what's shown below:

 

Capture.PNG 

Capture.PNG

CoreyM April 25, 2024

Thank you for the update. I'll try this option in my automation task. I appreciate it.

Like Laurie Sciutti likes this
0 votes
CoreyM April 24, 2024

We have a subtask created for one of our products that is only referenced it the product requires Compliance review. At this time, we are manually closing this task if review is not required. I would like to add a post function or automation to close this subtask upon transition of a different subtask if the workflow for this product does not require compliance review. Is this possible?

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2024

Hello @CoreyM 

The answer is "it depends".

What is the criteria?

What is unique about that subtask to be closed that you could use to programmatically identify it among the set of subtasks?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2024

We have a subtask created for one of our products that is only referenced it the product requires Compliance review. At this time, we are manually closing this task if review is not required. I would like to add a post function or automation to close this subtask upon transition of a different subtask if the workflow for this product does not require compliance review. Is this possible?

How do you identify the "different subtask" that would get closed and trigger the closing of the other subtask?

How do you indicate that Compliance review is required or not required? Is that a field/setting on the parent issue of the subtask?

Like Laurie Sciutti likes this
CoreyM April 24, 2024

We have two fields that can be used in a related subtask that can be used to identify whether the proceeding subtask is required or can be closed.

CoreyM April 24, 2024

This is what I was thinking. AutomationTask.jpg

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2024

I believe that it would be possible to implement your requirement with an Automation Rule, but we would need specific and actual information to provide an example solution for you.

If I understand correctly the rule would flow something like this:

Trigger: Issue Transitioned
-- To Status: Done
Condition: Issue Fields Condition
-- Issue Type equals Sub-task

I'm not to advise you on the next steps because I am unclear about
- the field(s) you are using to indicate a Compliance Review is required, and in which issue(s) those fields actually exist
- exactly how you are establishing the relationship between the subtasks such that when subtask A closes, you know that subtask B could also be closed.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2024

I did not see your update with the image of the rule before posting my last reply.

What are the possible values for the fields Add Compliance Appt Request and Add Compliance Product Request?

Under what circumstances are the values in these fields changed?

The way the rule is written it will transition the issue where the fields Add Compliance Appt Request and Add Compliance Product Request have been changed (and contain the specified values). I thought you wanted to close a related issue? Have I misunderstood?

CoreyM April 24, 2024

The two 'Compliance' fields are located in one subtask. If these fields are changes to one of the (NA, Not Completed) selections, I would like the Compliance subtask to close automatically since it would no longer be needed. Make sense?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2024

How do you uniquely identify the related Compliance subtask? Is that an custom subtask issue type? Is there ever only one such Compliance subtask per parent issue?

CoreyM April 24, 2024

Correct. Each parent issue Product has 4 unique subtasks; Pricing, Sales, Compliance and Verification. If the fields under the Sales subtask are changed, I want to close the Compliance task.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events