Counting Assignees in Child Issues with Jira Automation

Diego Martínez February 7, 2025

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!

 

automation 3.pngautomation 2.pngautomation 1.png

1 answer

0 votes
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.
February 7, 2025

Hi @Diego Martínez 

For a question like this, context is important for the community to help.  Please post the following:

  • an image of your complete automation rule in a single image for continuity,
  • images of any relevant actions / conditions / branches,
  • an image of the audit log details showing the rule execution, and
  • explain what is not working as expected and why you believe that to be the case.

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:

  • Have you confirmed the custom field is a text field?
  • Have you written the custom field to the audit log to confirm it contains what you expect?  For example, is the delimiter just a comma or is it a comma followed by a space, requiring a change to you split() function parameter.
  • What are you showing with that webhook response parsing of the Assignee field?  Is that the source of the custom field?

 

Kind regards,
Bill

Diego Martínez February 7, 2025

 

 

Here is a complete image of my automation:

Automation completa.png

 

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 

automation action 1.png

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.



Suggest an answer

Log in or Sign up to answer