Automation help: Advanced branching and smart values
Asked by Breanna Williams:

Hello, I am in a company managed project as an admin.

I am trying to set up an automation with specific criteria

* When all of the sub-tasks within the parent are transitioned to "completed" i would like for the Project owner (custom field) to be tagged in a comment

I have used smart value advanced branching for this comment tagging before but cannot figure out the order the rule should go in.

Thank you in advance!


Answers:
author: Bill Sheboy
body: Hi [@Breanna Williams](/t5/user/viewprofilepage/user-id/5143403)

Would you please post images of your complete rule and the audit log details showing the execution? Those may provide context for the community to offer ideas. Thanks!

Until we see those...

I am unclear why you would need an advanced branch for this scenario. An alternative would be:

* trigger: issue transitioned to completed
* action: lookup issues with JQL to find all sibling sub-tasks of the trigger issue which are NOT completed
* advanced compare condition: confirm there are none with {{lookupIssues.size\|0}} equals 0
* action: add the comment with the user mentioned. This will mention the user in the trigger issue (subtask). I you instead want the comment in the parent story, you could branch to that first.

Kind regards,  
Bill

comments: author: Breanna Williams
body: I was needing to use advanced branch using smart values due to it not being a specific user, but using the custom field -- making a smart value from the custom field and then mentioning the person within that field. Vs. using a specific persons account ID.

I do not have a screenshot of the rule as I was unable to piece it together.

[@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)


author: Bill Sheboy
body: Is your custom field a user field or something else? If it is a user field the accountId value is still available:

{{issue.*myCustomUserField*.accountId}}


author: Breanna Williams
body: ![Screen Shot 2023-07-19 at 7.15.32 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/269988i65930378A5FCDD38/image-size/large?v=v2&px=999 "Screen Shot 2023-07-19 at 7.15.32 PM.png")

This did not tag them when the automation occurred! It did leave the comment but there was no mention.


author: Breanna Williams
body: ![Screen Shot 2023-07-19 at 7.17.12 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/269989i5ACA6374BEB2C37B/image-size/large?v=v2&px=999 "Screen Shot 2023-07-19 at 7.17.12 PM.png")

An example of what I have done before using the smart value [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)


author: Breanna Williams
body: Oops sorry - yes it is a custom field for a user picker (single)


author: Bill Sheboy
body: I wonder if the smart value you are using for your field is incorrect.

Smart values are name, spacing, and case-sensitive, and when they are incorrect they just return an empty / null string.

You can confirm field's smart value using this how-to article. Essentially you identify an example issue which has your field, call the REST API from a browser, and then search for your field on the page to find the correct smart value.

<https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/>


Tags: atl-gruland