Hi,
I am creating an automation rule that gets the unique values from a multi-select field in order to populate a list. Being that this field allows multiple selections for the tickets (ex. C++, Unity, Javascript), there will be other tickets in the same release that will have one or more of the same values selected. The following smart value was created for the rule:
{{lookupIssues.customfield_12345.value.distinct}}
Example:
Three tickets are in the release.
One has C++ only selected in the aforementioned field.
The second has C++, Unity selected.
The third has C++, Unity, and JavaScript selected.
Run the rule.
The result when the email is received:
[C++, C++, Javascript, Unity, C++, Unity]
The expected would be to just have the unique values appear to represent what was worked on for the release.
Is there a way to just get only the unique values in the list of tickets to be returned? Any guidance would be appreciated. Thanks.
Hi @Keith Vedol
That is working as expected...What is happening is the distinct function is applying to the set-of-selections for your custom field, and with 3 choices there could be 2^3 or 8 possible results.
The work-around is to merge the sets before using distinct. Please try this one:
{{lookupIssues.customfield_12345.value.join(",").remove("[").remove("]").replace(", ",",").split(",").distinct}}
How this works:
Please note the results may not match the order of your selection list items. A work-around for that is to add ORDER BY cf[12345] ASC to your lookup issues JQL, as that will at least be in alphanumeric sort order.
Kind regards,
Bill
Hi @Bill Sheboy
The solution you advised works perfectly. Thank You for the response and the assistance!
Regards,
Keith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
Please, do you have an idea how to achieve this result with a list of users, when using custom field multi user picker? I am able to get a list of distinct account IDs this way but I can't email them.
I'm trying to achieve this automation trick but with multi user picker so users potentially receive multiple emails.
Thank you for any advice.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perhaps...it is the same concept, except using the "value.emailAddress" attribute rather than "value" as shown above. The reason is the user picker fields returns user objects, and that will include all the needed attributes.
To confirm this the community would need to see your rule and know your project type: company-managed or team-managed. This technique will not work for a team-managed project's People-type fields, as those do not provide an email address.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
Thank you for your reply. I think we've figured it out in the end. We are in company managed projects.
Let's call the multi user picker field "Solvers".
We do an advanced branching with Bill's join-and-split technique so we get a list of distinct email addresses.
{{lookupIssues.customfield_10525.emailAddress.join(",").remove("[").remove("]").replace(", ",",").split(",").distinct}}
For each address, we Lookup issues. The trick was to coat the smart value in quotation marks, so email address works:
Solvers in "{{advancedBranch}}"
The rest is easy peasy, follow the KB article linked in my previous comment.
Cheers,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I'm trying to create an automation rule very similar to the one Keith Vedol mentioned, but I'm having some problems with updating the field with the list of values.
In my case, I want to keep a field of an issue updated with all the values that the child issues have for the same field.
I've created a rule that every time there's a change to this field, it fetches the values for the field from all the child issues to update the parent issue. I can get the list with the unique values, but I can't update the parent field with that same list.
Can you help me?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @LuisPinto
This is a very old thread, and so I recommend creating a new question. That will ensure the maximum number of people see it to offer suggestions, and to help focus on your question.
When you create your question, perhaps add a link back to this thread, and include the following for context:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy i will create a new question with all the details you said. Thank you
Best regards,
Luis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.