Forums

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

How to set start date on parent ticket if there are multiple subtasks.

Pete Jaworski July 24, 2023

I would like to set the Start Date on a Parent Issue (Story and Epic) when the FIRST story or subtask gets moved into Development.

I have an issue where every time a subtask or Story moves into Development the Start Date Changes on the Epic or Story Level.

There are times where the subtask are in different stages of the workflow, but the start date keep changing every time that it may go in and out of a status. See Example screenshots.

 

Example Story with Subtasks.pngAutomation Rule Start Date - Story.pngAutomation Rule Start Date - Subtasks.png

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
July 24, 2023

Hello @Pete Jaworski 

You will need to add Condition(s) to check if there is more than one "child" issue in the "In Development" status and only change the Start Date of the parent when there is only one "child" issue in that Status.

Something like this should work:

Screen Shot 2023-07-24 at 1.45.41 PM.png

Pete Jaworski July 24, 2023

@Trudy Claspill @hank you for the quick response. Should I add this to my Existing Rule when I not only transition subtasks to "In Development" and update the User Story status, also the start date?

Also, for some reason the JQL Lookup issues is not able to validate the query. Is that look correct?

parent = {{issue.key}} and status="In Development"

Screenshot 2023-07-24 at 5.03.43 PM.png

Trudy Claspill
Community Champion
July 24, 2023

In an Automation Rule the Validate Query option will not work when the query includes smart values, because the smart values cannot be evaluated except when the rule is executing.

As per your latest image the parent's Start date will updated only when a subtasks transitions to In Development and that is the only subtask in that status. The change of the parent's Status will not be affected by the change.

I do wonder though if you have the rule set the way you really want it for changing the parent's Status.

If any subtask is transitions to "In Development" from one of the specified statuses then the parent issue will also be transitioned to "In Development" regardless of what status that parent is in currently.  

1. You might want to add a check to confirm that the parent's Status is not already "In Development".

2. In addition, do you want the parent to try to transition to "In Development" regardless of its current status? Are there any statuses from which the transition to "In Development is not possible? If so you might want to consider other current status values to check for on the parent in #1.

3. If you do opt to add a condition to check the parent's status, then I would recommend having two separate branches; one for updating the parent's Status and the other for updating the parent's Start date. If you keep them in the same branch, then the first condition that fails will cause the branch to exit without proceeding farther to assess any additional conditions.

Pete Jaworski July 25, 2023

Gotcha.

 

What I really want is:

1. If any subtask is transitions to "In Development" from one of the specified statuses then the parent issue will also be transitioned to "In Development" regardless of what status that parent is in currently.  

2. Then, when the Parent is "In Development" status, add the current date as the start date.

 

How would these two rules look like? My main issue im trying the solve is the start date updating everytime a new subtask, under the parent, moves to "In development", its messing up my start date.

Pete Jaworski July 27, 2023

@Trudy Claspill - Can you help by showing what these two branch will look like? One for the change in status for the parent, and the other for Start Date?

Trudy Claspill
Community Champion
July 27, 2023

I have not had time to get back to this, but I will try to do so in the next few days.

Pete Jaworski August 16, 2023

Hi @Trudy Claspill - Just following up on this. I really appreciate your advice on this. Some of my logic is screwing things up, so hoping to get this resolved.

Trudy Claspill
Community Champion
September 17, 2023

Hello @Pete Jaworski 

Sorry it has taken me so long to get back to you.

 

Rule 1: When a subtask transitions to "In Development" from a specified status

a. The parent "story" transitions to "In Development" regardless of what status it is in.

b. The Start Date of the "story" is set to the current date, if and only if this is the first subtask to transition to "In Development"

By putting the Lookup Issue action after the step where the parent story is transition, the parent story will always been transition. Then you using the Lookup and the following Condition to figure out if the subtask that transitioned is the only subtask in the "In Development status.

The (*) Condition is one I'm not sure if you want.

Does the Start Date of the parent story ever get set in another manner, or should it only be set by the first subtask moving to In Development? If the subtask transition is the only time the parent Start Date should be set, then add this condition. This handles the scenario where you have had one subtask move to In Development and then to Done, and then you have another subtask move to In Development. Without this condition, the move of the second subtask to In Development while other subtasks are To Do or Done would result in the Lookup again finding only 1 subtask In Development and updating the Start Date. I think you don't want that.

If the Start Date of the parent might get set by some event other than the transition of the first subtask to In Development, what would that other event be? And would you still want the transition of the subtask to casue an update to the Start Date?

 

TRIGGER: issue transitioned
From status: <your specified statuses>
To status: In Development

CONDITION: Issue Fields Condition
Field: Issue Type
Condition: is one of
Value: <select all the subtasks issue types that are relevant>

BRANCH FOR: Related Issues: Parent

ACTION: Transition issue
Destination Status: In Development

ACTION: Lookup Issues
JQL: issuetype = Sub-task and parent={{issue.key}} and status="In Development"

CONDITION: Advanced Compare
First Value: {{lookupIssues.size}}
Condition: equals
Second value: 1

(*) CONDITION: Advanced Compare
First Value: {{issue.Start date}}
Condition: equals
Second value: EMPTY

ACTION: Edit issue
Field to set: Start date
Value: {{now.jiraDate}}

 

 

Rule 2: Basically the same as Rule 1, but applies to updating an Epic when a child Story is transitioned. Modify the first Condition, the Branch option, and the Lookup Issues inside the Branch.

TRIGGER: issue transitioned
From status: <your specified statuses>
To status: In Development

CONDITION: Issue Fields Condition
Field: Issue Type
Condition: is one of
Value: <select all the "story" issue types that are relevant>

BRANCH FOR: Related Issues: Epic (parent)

ACTION: Transition issue
Destination Status: In Development

ACTION: Lookup Issues
JQL: "Epic Link" = {{issue.key}} and status="In Development"

CONDITION: Advanced Compare
First Value: {{lookupIssues.size}}
Condition: equals
Second value: 1

(*) CONDITION: Advanced Compare
First Value: {{issue.Start date}}
Condition: equals
Second value: EMPTY

ACTION: Edit issue
Field to set: Start date
Value: {{now.jiraDate}}

Suggest an answer

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

Atlassian Community Events