Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can i summarize the values of custom fields 'X' in another custom field 'X Sum'

Casper
Contributor
July 20, 2023

I have:

- Parent issue with custom filed 'Team Sum'
- Sub-Tasks with custom field 'Team'

Goal:
I want to summarize the values of the field 'Team' in the custom field 'Team Sum'

 

Additionally:

The custom field 'Team' is a multiple option to choose type.
The field 'Team' values are: 'Front' 'Back' 'QA' etc...

 

Example:

If the Parent has two sub-tasks like:

-Sub-task 1, has the option 'Front' in the field 'Team'
-Sub-task 2, have the option 'Back' in the field 'Team' 

-Custom field 'Team Sum' in the Parent issue has options 'Front' & 'Back' 

Also:
I know how to summarize the story points, and I tried to do the same with the field team, but it didn't work, here is how I did it:

Screenshot 2023-07-20 at 16.07.34.png

2 answers

1 accepted

2 votes
Answer accepted
Luka Hummel - codefortynine
Atlassian Partner
August 7, 2023

Hi Casper,

I'm Luka from codefortynine and I think your use case is an interesting use case for our app Dynamic Custom Fields for Jira.

If you want to avoid the limitations of Jira Automations, you could try to add this Jira expression as a Dynamic Custom Field (You need to replace the custom field ID with the corresponding custom field ID of your instance. You can read more on how to find your custom field ID here):

issue.subtasks?.flatMap(s => s.customfield_10145 != null ? s.customfield_10145 : null).flatMap(f => f != null ? f.value : null).sort()

I have to admit, the expression will not filter out duplicate teams, but that might be possible with some Jira expression magic beyond my comprehension.

2023-08-07 17-29.png

Let me know if this would work for you.

0 votes
Kseniia Trushnikova
Community Champion
July 20, 2023

Hi @Casper,

Is Team Sum a text field? If so, try to add this to the action Edit issue:

{{issue.subtasks.Team.value.flatten().distinct().join(" & ")}} 
Casper
Contributor
July 21, 2023

Hi @Kseniia Trushnikova ,
Yes, is a text field.

I created a Field 'Team Sum' as a:
- Text field ( Read-Only )
- Select List ( Multiple Choices )

Try to use your solution, and it doesn't work.

Screenshot 2023-07-21 at 12.39.53.png

Kseniia Trushnikova
Community Champion
July 21, 2023

@Casper, there’s the field Teams instead of Team Sum on your screenshot. Are these fields the same?

Can you please share the rule logs?

Casper
Contributor
July 21, 2023

Yes, Team Sum = Teams.

Thank you!Screenshot 2023-07-21 at 12.54.40.png

Kseniia Trushnikova
Community Champion
July 21, 2023

@Casper, everything looks right… The parent issue has been edited.

Can you share the new value of Teams in DST-346?

Casper
Contributor
July 21, 2023

Sure,


Screenshot 2023-07-21 at 13.02.19.png

Casper
Contributor
July 21, 2023

Maybe I need to use not a 'text field ( read-only )' or some other type of field?

Or it doesn't matter?

Casper
Contributor
July 21, 2023

Here are the fields,

Screenshot 2023-07-21 at 13.04.24.png Screenshot 2023-07-21 at 13.04.29.png

Kseniia Trushnikova
Community Champion
July 21, 2023

@Casper, this may be the reason. Can you test the rule with any other text field, not read-only?

Like • Casper likes this
Casper
Contributor
July 21, 2023

I create the field:

Screenshot 2023-07-21 at 13.08.52.png

 

The result:
Screenshot 2023-07-21 at 13.12.13.png Screenshot 2023-07-21 at 13.12.30.png Screenshot 2023-07-21 at 13.12.39.png

Kseniia Trushnikova
Community Champion
July 21, 2023

@Casper, for some reasons it works in my Jira. I've just tested it with a select List (multiple choices) and a text field (single line).

Please check are there any entries in the parent issue history? 

Like • Casper likes this
Casper
Contributor
August 1, 2023

Thank you @Kseniia Trushnikova
I will try to fix it.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, confluence, loom, atlassian intelligence, ai notes, ai-powered meeting notes, atlassian community events, ace, confluence ai, loom ai integration, ai note-taking, atlassian ai features, team '25, atlassian live learning, confluence automation

Unlock AI-powered meeting notes: Join our live learning session! 📹

Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.

Register today!
AUG Leaders

Atlassian Community Events