Forums

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

Automation rule for child issue to inherit Team field

Dean Pellizer March 6, 2023

Hi everyone I have an issue with my automation rule below. This is working but I am getting some colleagues informing me is removing their team field from the newly created issues, even if those issues don't have a parent.

{

  "fields": {

    "team": "{{issue.epic.team.id}}"

  }

}

2 answers

1 vote
Barnali Putatunda
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.
March 6, 2023

HI Dean,

You should add an condition before this action as if only the issue has a linked epic, then only this action should be performed.

Now, this action is always executing & for the issues which does not have linked epic, so it is not getting any team id, so removes it.

I hope it clarifies the problem & you solve it.



Dean Pellizer March 8, 2023

I am very new to the whole automation feature, may I ask how can I apply that condition?

Barnali Putatunda
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.
March 8, 2023

HI Dean,

I am unable to upload a picture due to some issues at this moment, but let me try to explain it here.

After the trigger & before the action insert a condition.
Use a JQL condition. JQL would be like this: "Epic Link" is not Empty


0 votes
Trudy Claspill
Community Champion
March 6, 2023

Hello @Dean Pellizer 

Welcome to the Atlassian community!

Please show us the entire rule. The execution of steps is very dependent on the context at the time the step is executed. We can't tell you conclusively why your rule is doing what it does without all the information.

@Barnali Putatunda presents a very good suggestion that might solve your issue, but it really depends on seeing all the steps in the rule.

Dean Pellizer March 8, 2023

So this is the automation rule below.image001.png

Trudy Claspill
Community Champion
March 8, 2023

Yes, as written this would remove the value in the field when the issue does not have a parent, because you have no condition to ensure that the created issue has a parent. In that case, the step to Edit the issue is still executed, but no value can be found for the smart value you specified. That is not recognized as an error. Instead the issue being edited ends up with its Team field set to null.

Since your smart value references Epics, I assume that you want this to execute only for standard level issues types (i.e. Story, Bug, Task, etc.) and not for created Epics or Subtasks. In that case I recommend that you add a condition after the trigger to check that the issue type is not Epic and not in subtaskIssueTypes().

Screen Shot 2023-03-08 at 3.35.30 PM.png

 

Next I would add a Condition/Related Issues  to ensure the trigger issue has a parent Epic.

Screen Shot 2023-03-08 at 3.36.19 PM.png

And then have your Action to Edit the issue. Then the trigger issue will only be edited if it is a standard level issue that has a parent Epic.

 

You might also want to consider whether or not you want to copy the Team field from the parent Epic if the Team field in the parent Epic is blank but the Team field in the trigger issue is not blank.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events