Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

For each loop through Custom Field - Multi-Pick User Field

Tania Schmittou October 3, 2024

Following instructions in this link below, I have created an automation where I want to loop through all the user names in a custom multi-pick user field and create a ticket for each user.  Sounds simple enough.  I am using Advanced Branching but the error says "unable to be resolved to an object" for the branch.  Is it possible to loop through this type of custom field and, if so, does anyone know correct format to define the smart value for it?  

https://community.atlassian.com/t5/Automation-articles/Branching-over-smart-values-in-Jira-Automation/ba-p/1741935 


Advanced Branching.png


Advanced Branching 2.png

1 answer

1 accepted

2 votes
Answer accepted
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 3, 2024

Hi @Tania Schmittou 

You may do that by iterating over the selected values in the field.  Please change the smart value expression for your branch to this:

{{issue.customfield_16927.value}}

 

Also, are you trying to create new issues and immediately transition them to a specific status?  If so, I believe you will need to either use advanced edit to add the new status or call the REST API to do so.

As written, your rule cannot branch to the newly created issues, and so the Issue Transition action will always act upon the trigger issue.

 

Kind regards,
Bill

UPDATED (please see strikethrough above): Apparently the transition is not working in the Create Issue action with advanced edit.  Instead the REST API would need to be called after the issue create...or, a second rule could be used to transition the issues once they are created.

 

Tania Schmittou October 4, 2024

@Bill Sheboy   Thank you for your prompt answer, I have tried that as well.  The logic does not even get to the create issue or transition actions (fyi, I have been successful with using the Transition Issue after Create Issue to transition these).  The error happens on the Advanced branching step.    
Advanced Branching 3.png

Tania Schmittou October 4, 2024

@Bill Sheboy - Looks like my custom field shares a similarly named custom field and I had the wrong ID in my smart value!  It still won't resolve the "value", but does resolve the field itself and I am able to use the account IDs.  Thank you!

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 4, 2024

Tania, I recommend pausing to identify the correct smart value (or custom field id) for your field using this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

 

Then, add a write to audit log before the branch to confirm what the field contains, and re-test.  That may help indicate why the branch is not working.  Thanks!

Tania Schmittou October 7, 2024

Hi @Bill Sheboy - I did identify the correct custom field and branch is working. Thank you for all your advice.  

Like Bill Sheboy likes this
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 7, 2024

Awesome; I am glad to learn it is working!  Please consider marking this question as "answered" to help others with a similar need find solutions faster.  Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events