Automation based on the summary text and status
Asked by Pradheep Ayyanar:

Can we write an automation script checking the summary of the sub task and its status if completed, change the status of few issues to Inprogress.

I have multiple projects, but the summary of this particular task is same for all projects. so i need to trigger based on the text

Ex:

MYProject_1 (sub-task): Ready for construction - if this task is completed

MyProject_2, MyProject_3 - status to be changed to In Progress

Help me out


Answers:
author: Trudy Claspill
body: Hello [@Pradheep Ayyanar](/t5/user/viewprofilepage/user-id/5549295)

Are these issues all in one project or in separate projects?

How do you identify the issues that need to be changed to In Progress? Are they linked to the subtask?

What event do you want to trigger this rule? Would that be the changing of the subtask to Completed?

comments: author: Pradheep Ayyanar
body: [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

Project

Epic

Story

Sub-Tasks 1

Sub-Tasks 2

Sub-Tasks 3

\[am a beginner to this Jira automation\]

I have single project with many epic (which is treated as project) . So to answer your question. Yes its all in a single project but Sub-Tasks 1 under all the Epic to be validated with the same criteria.

ex: if sub-tasks 1 is changed to completed, change the status of Sub-tasks 2

since all my projects with have the summary text for sub-tasks.

status change event is what needs to be triggered


author: Trudy Claspill
body: Let me repeat back what I think you said. Correct me if I make an error.

When the status of Sub-task 1 changes to Completed  
You want to change the status of Sub-task 2, which is under the same Story as Sub-task 1.

All Sub-task 1 tasks (under multiple Stories, under multiple Epics) have identical Summaries.

You want this rule to be triggered for every Sub-task 1.

The rule will identify that it is Sub-task 1 that changed to Completed by looking at its Summary, so that the rule runs only for Sub-task 1 issues.

If that is all correct, how do you identify which issue is Sub-task 2; the one that needs to be updated? Do all Sub-task 2 issues have a specific Summary unique to Sub-task 2 issues? Do you create a link between Sub-task 1 and Sub-task 2 under a given Story?


author: Pradheep Ayyanar
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

Yes you are inline with my request.

All the sub-task 2 will have the same summary text for all epics (projects).

So when task 1 is complete.

I need to update the status of task 2 in the same epic to In progress

if the sub-task 2 issue has to be linked as "related to" or any link issue, i can do that. so we can identify easily?

Note: So its all specific to the EPIC. not all the sub-tasks in each of Epic should be changed.


author: Trudy Claspill
body: Let me repeat back what I think you said. Correct me if I make an error. Modifications are **bold**.

When the status of Sub-task 1 changes to Completed  
**And that subtask has a particular value for Summary**   
**And that subtask exists under child issues under Epics where the Epic meets certain conditions**   
You want to change the status of sibling Sub-task 2, which is under the same Story as Sub-task 1.

**The rule will identify the sibling Sub-task 2 (under the same Story) based on the value of the Sub-task 2 Summary field.**

What is the criteria for identifying that the sub-task is under a qualifying Epic?


author: Pradheep Ayyanar
body: ![automation-subtask.png](https://community.atlassian.com/t5/image/serverpage/image-id/348246i279CB59CA2617125/image-size/large?v=v2&px=999 "automation-subtask.png")

This is how my structure is.

ex: if my "MDU_7156" is COMPLETED, can i have an automation to say MDU_7157 and MDU_7158 to be set "In Progress"

all the sbu-tasks are under a story.

Likewise this is the same structure for all my projects with the same set of sub-tasks.

Hope its clear now and my ask is to automate status change is a sub-task is set to COMPLETED. based on your experience with Jira, suggest me a way to set this up or if there needs any link issue to be added, etc.


author: Trudy Claspill
body: I don't think I clearly understand your requirements, so I will start with this set of requirements.

When an issue is transitioned to Complete  
And that issue is a Sub-task  
And the Summary of that issue is **18.05 Ready to construct (100%)**   
Then find all sibling subtasks that have the Summary **18.1 MDU Equipment Received**   
And transition those subtasks to In Progress

```
Trigger: Issue Transitioned
  To Status: Complete
Condition: Issue Fields Condition
  Field: Issue Type
  condition: equals
  Value Sub-task
Condition: Issue Fields Condition
  Field: Summary
  condition: equals
  Value: 18.05 Ready to construct (100%)
Branch: Related Issues: JQL
  JQL: parent={{issue.parent.key}} and Summary ~"\"18.1 MDU Equipment Received\""

    Action: Transition Issue
      Destination Status: In Progress
```


author: Pradheep Ayyanar
body: [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) Yes abs this is the need. Thanks

But the status change **18.1 MDU Equipment Received**should only be in the same Epic and not for all the tasks under all Epics. so need to add only the condition.


author: Trudy Claspill
body: No, another condition is not needed.

First, the Subtasks are under the Story, and the Story is under the Epic. The Subtasks are not directly "under" or "in" the Epic.

Second, this part of the JQL

parent={{issue.parent.key}}

is used to get a matching subtask **under the same Story** as the subtask that triggered the rule.

The only subtask that will be changed by this rule execution, using your example data, is MDU_7157.


author: Pradheep Ayyanar
body: thanks [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

Let me try with your suggestion and JQL and will come back if needs more clarification.

First is that my structure is like the one mentioned below and this needs to be the input format for the automation.

Project

Epic

Story

Sub-tasks


author: Trudy Claspill
body: If you are using "Project" to reference the Jira Project (the container for issues), you specify the Project to be affected when you set the Scope of the rule. The Project does not need to be mentioned in the steps of the rule in that case.


author: Trudy Claspill
body: Hello [@Pradheep Ayyanar](/t5/user/viewprofilepage/user-id/5549295)

Were you able to solve your requirement with the information I provided? If so, please consider clicking on the Accept Answer button to mark your Question as Solved.

If you still have questions about this solution, please let me know.


author: Pradheep Ayyanar
body: Yes it did work. Thanks for the support and I had accepted answer now.


Tags: cloud

jira-cloud