Forums

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

Using automation rules, how to get the parent issue type for a subtask

Joni Johnson
Contributor
October 17, 2022

Trying to create an automation rule that synchronizes a custom field on a subtask to its parent (e.g. story) as long as the parent issue type is NOT a custom created issue type names "App Release".  The "App Release" is at the same level as the story and task. For example:

  • There is a custom field that is required on every issue created including subtasks. We'll call it "initiative". 
  • Story A has initiative value of B. There are three subtasks that have initiative value B.
  • App Release B has initiative value of C. There are three subtasks on it with initiatives D, E, and F.
  • When I change the initiative of one of the subtasks for Story A to F, the subtask initiative is reset to B.
  • When I change the initiative of one of the subtasks for App Release B to Z, the subtask initiative is NOT to be reset to B. 

I've tried using the SmartValues yet can't see how to access the issue type of the parent.

Currently, when I change the subtask value for the subtask associated to App Release, it sets the value of the subtask to the initiative value of the App Release. So in my example, it changes the value to B.

2 answers

1 accepted

2 votes
Answer accepted
Walter Buggenhout
Community Champion
October 17, 2022

Hi @Joni Johnson,

When working with parent issues etc. you will need to create a branch in your automation rule to determine that you're going to update your linked issues. Inside that branch, you can apply additional conditions.

So just add such a condition to specify what types of parent your issues should be updated. Something like this:

Screenshot 2022-10-17 at 16.44.47.pngI don't have an initiative custom field, so I used components instead, but I hope you get the idea.

Hope this helps! 

Joni Johnson
Contributor
October 17, 2022

Walter,

Thank you for sharing and including the image. I tried this yet couldn't figure out how to update the initiative value on the trigger issue (subtask) to the initiative of the parent when the issue type was not an App Release using the For Parent.  I know I will use the For Parent with other rules so appreciate the sharing.

Regards,

Joni

2 votes
Bill Sheboy
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.
October 17, 2022

Hi @Joni Johnson 

You are trying to conditionally update the trigger issue (a subtask) based on the type of the parent, correct?

If so, you may access the parent's issue type with {{issue.parent.issueType.name}} to compare based on the issue type name.  That would make your rule something like this:

  • trigger: field value Initiative changed
  • advanced compare condition: to check {{issue.parent.issueType.name}} does not equal "App Release"
  • action: edit issue to change the Initiative field, copying the value from the parent
  • bonus action: I recommend perhaps notifying the {{initiator}} with a mention so they know why this change occurred, helping to inform them of your rule/practice

Kind regards,
Bill 

Joni Johnson
Contributor
October 17, 2022

Bill,

Thank you so much! This worked perfectly! I added a comment to note why this was changing also as that is a great suggestion.

Grateful for your sharing.

Joni

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events