JIRA Automation: Set issue status when subtask is assigned
Asked by Christian Fischer:

We work with subtasks and our manualy rule is, that when the first person is assigned to a subtask then this person has to set the issue status to "In Progress".

How can I do that automaticly?

There is no "Subtask assigned" trigger and as i tried "Issue assigned" is not triggered ba a subtask.

So how do I set this up?

Thanks for any hint!


Answers:
author: Tim C
body: Hi [@Christian Fischer](/t5/user/viewprofilepage/user-id/5371255)

Welcome to the Atlassian community ...

I think something like this should be fine ... see below:

![Screenshot 2023-11-23 122542.png](https://community.atlassian.com/t5/image/serverpage/image-id/293429i2E577F4409542AFC/image-size/large?v=v2&px=999 "Screenshot 2023-11-23 122542.png")

I hope this helps.

Thanks,

Tim C

comments: author: Christian Fischer
body: I tried something similar and now this one.

This rule sets the status of the subtask to "In Progress". But I would like to have the story to have this status.


author: Tim C
body: Updated ...

![Screenshot 2023-11-23 123739.png](https://community.atlassian.com/t5/image/serverpage/image-id/293432iEC3D3308ABA5B492/image-size/large?v=v2&px=999 "Screenshot 2023-11-23 123739.png")


author: Christian Fischer
body: THANKS A LOT!  
So fare I didn't know the branch "Parent". This was the missing part in the rule!

GREAT!


author: Tim C
body: Great - glad that you're now sorted.

Please accept above answer so that the question shows as "solved".


author: Ste Wright
body: Hi [@Christian Fischer](/t5/user/viewprofilepage/user-id/5371255)

This should work:

* **Trigger:**Issue Assigned
* **Condition:** Issue Fields Condition
  * Field = Issue Type
  * Condition = equals
  * Value = Sub-task
* **Condition:** Issue Fields Condition
  * Field = Status
  * Condition = does not equal
  * Value = In Progress
* **Action:** Transition Issue
  * Destination Status = In Progress

---

This would execute each time a user is assigned though - is that the right behaviour? Or is it only when the **first**user is assigned?

If the latter, is it possible to move to other statuses and back to In Progress within your workflow?

Let us know if this works for you!

Ste

comments: author: Christian Fischer
body: See my answer below. This rule does not set the status of the story like I want to be set automaticly. It sets the status of the subtask.

Wheen the first subtask is assigned then the status of the story should be set to "In Progress".


author: Ste Wright
body: Hi [@Christian Fischer](/t5/user/viewprofilepage/user-id/5371255)

Apologies, I wasn't sure which option was required above.

Rule would look something like this:

* **Trigger:**Issue Assigned
* **Condition:** Issue Fields Condition
  * Field = Issue Type
  * Condition = equals
  * Value = Sub-task
* **Condition:** Issue Fields Condition
  * Field = Assignee
  * Condition = is not empty
* **Branch:** Related Issues
  * Type = Parent
    * **Branch-Condition:** Issue Fields Condition
      * Field = Status
      * Condition = does not equal
      * Value = In Progress
    * **Branch-Action:** Transition Issue
      * Destination Status = In Progress

---

Again, this would execute for every Sub-task not just the first one.

If you need the rule to only execute once, you could add an issue property in the first execution, which will stop the rule activating again the second time around.

Rule will look something like this:

* **Trigger:**Issue Assigned
* **Condition:** Issue Fields Condition
  * Field = Issue Type
  * Condition = equals
  * Value = Sub-task
* **Condition:** Issue Fields Condition
  * Field = Assignee
  * Condition = is not empty
* **Branch:** Related Issues
  * Type = Parent
    * **Branch-Condition:** Issue Fields Condition
      * Field = Status
      * Condition = does not equal
      * Value = In Progress
    * **\*\*\*Branch-Condition:** Advanced Compare Condition
      * First Value = {{issue.properties.subtaskassign}}
      * Condition = equals
      * Second Value = *\<leave empty\>*
    * **Branch-Action:** Transition Issue
      * Destination Status = In Progress
    * **\*\*\*Branch-Action:** Set entity property
      * Entity Type = Issue
      * Property Key = subtaskassign
      * Property Value = true

---

The Condition/Action with **\*\*\***next to them are the differences here - these two items...

* Check if an issue property called subtaskassign is populated
* If not, it creates it

This will mean the rule runs only once - the first time it is executed.

---

Let us know if this works for you!

Ste