Hi Community,
I'm trying to count unique assignees in child issues using Jira Automation. I have a custom field (customfield_18610
) that stores assignee usernames separated by commas. For example:
adminbr,Diego,Diego
I want to count the number of unique assignees and store that value in another field. I’ve tried the following expressions, but they always return 0
:
{{issue.customfield_18610.split(",").distinct.size}}
In this case, the expected unique count should be 2
, since Diego appears twice but should only be counted once.
Is there a way to properly transform this field into a list and count the unique values using distinct
or any other method in Jira Automation?
I’d appreciate any help or suggestions!
For a question like this, context is important for the community to help. Please post the following:
Until we see those...
First thing to try: your rule appears to be editing the issue multiple times.
When a rule edits an issue, that updates the database only, not the data the rule has for the issue in-memory. To get the updated information, the Re-fetch Issue action must be added after the edit to reload the issue data: https://confluence.atlassian.com/automation/jira-automation-actions-993924834.html#Jiraautomationactions-refetchissuedataRe-fetchissuedata
If that does not help, please also answer the following:
Kind regards,
Bill
Here is a complete image of my automation:
In this action, I take the value from the webhook response and store it in a custom field.
This is an example of the responde that I get adminbr,JIRAUSER22508,JIRAUSER22508
I want the result to be like: adminbr,JIRAUSER22508 instead of adminbr,JIRAUSER22508,JIRAUSER22508, and the count should be 2, since there are repeated values.
For this, I’ve tried using {{issue.customfield_18610.split(",").distinct.size}}, but the returned value is 0.
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.