Forums

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

Automation firing when branching condition not met

Joshua Smith March 27, 2024

Hi there, I am very new to some aspects of automation, particularly branching. What I'm trying to do is this: If field A "request type" on parent issue ="abc", AND if subtask #1 is marked "done," THEN create subtask #2. 

My automation is as follows: 

When value changes for "status"

Issue type = subtask

Status = "done"

--> (branch - for: parent) request type ="abc"

if sub-tasks <2

--> (branch - for: parent) then edit issue fields "detailed status"

--> (branch - for: parent) then create new subtask

 

My thought is that if any of the bolded items above are not true, then a subtask should not be created and the detailed status should not be updated, but you can see below the "request type" condition is not met and the automation is still firing. What can I do differently? Thank you!Snag_99720f85.png

2 answers

1 accepted

0 votes
Answer accepted
Kalyan Sattaluri
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 27, 2024

Hello @Joshua Smith 

You can access a sub-task's parent's info using smart values.

So if you want to check a sub-task parents request type is abc, you dont need a branch. You can do a smart value if condition.

Your steps will be:

Trigger = Issue transition to Done

If condition => If issue type = Subtask

If Condition (smart values) => If {{issue.parent.Request Type}} equals abc

lookupIssues with JQL => parent = parent = {{issue.parent.key}}

If Condition =>{{lookupIssues.size}} less than 2

Then create Issue with 

  • Project = project where Parent issue exists
  • Issue type = subtask
  • Parent Issue = {{issue.parent.key}}

Please see screenshot below, I have highlighted key steps and create subtask section for quick reference.. let us know if questions.

image.png

Joshua Smith March 27, 2024

Thank you very much for the detailed response and screenshot, this is very helpful and I think I'm about 95% there.

The third step - the compare of whether {{issue.parent.Request Type}} equals abc, is not checking the parent but the subtask which triggered the automation - I can see it in the audit log.

Any suggestions? Is "issue.parent" a pre-defined function, or is that a variable that I need to set?

Kalyan Sattaluri
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 27, 2024

@Joshua Smith 

 If trigger issue is a sub-task, {{issue.parent.Request Type}} will give you the parent's request type field value.

Please log above smart value before the If condition share the screenshot. 

Also, the value is case sensitive so abc != ABC. 

Joshua Smith March 27, 2024

Did a bit more looking and figured out the field in question, "Request type," exists multiple times so I think that threw it off. Renamed the field and updated the smart value accordingly, and it worked. Thanks very much!

Like # people like this
0 votes
YY Brother
Community Champion
March 27, 2024

Hi @Joshua Smith 

 Welcome to our Community. Could you please provide the screenshot of "My automation is as follows" part?

Thanks,

YY哥

Suggest an answer

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

Atlassian Community Events