Scriptrunner Scripted Field - Sum of CustomFields within a Project

Luca Kainzner September 6, 2024

Hey all, 

Wish you a good day. 

I'm trying to calculate the sum of all custom fields within a project.

Example:

I have a custom field: Beantrage Fördersumme €

I want to sum up all "numbers" in all customfields of every issue inside a single project (project name "IDIM").

image.png

I have looked over the ScriptRunner library and various Snippets, but I'm still not getting the expected result.

Thanks in Advance

Luca 

3 answers

Suggest an answer

Log in or Sign up to answer
1 vote
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 6, 2024

Hi @Luca Kainzner

In your description, you mentioned:-

I want to sum up all "numbers" in all customfields of every issue inside a single project (project name "IDIM").

From your description, it appears you want to calculate values from multiple custom fields and sum up the total in a Scripted Field. Is this correct?

If yes, then I have already provided a similar solution in this Community Post. Please note that the solution provided may not be 100% exact to your requirements. Hence, you must modify the code accordingly.

It would be helpful if you could provide a screenshot of the fields you intend to include in the calculation, and I could try to provide a sample code.

I am looking forward to your feedback and clarification.

Thank you and Kind regards,
Ram

Luca Kainzner September 9, 2024

Hello Ram :)

Hope your doing good :) Wish you a nice day.

Actually i saw this post, but I didn't got it to implementate correctly. 

The actual use case is to sum up all fields ("Beantrage Fördersumme €" ; customfield_24704) within a project "IDFM" and to visualize it within a dashboard or similar - I thought the easiest way would be just another field where sum of alle these fields is visible. ("Summe Beantragter Fördersummen €" ; customfield_25201)

 

image.png

Cheers Luca 

Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 9, 2024

Hi @Luca Kainzner

Thank you for getting back and providing the requested information.

Just another doubt to clarify: are the values in the Number fields set with Decimal points or with normal Integer type numbers?

Also what Locale format are you using for the Numbers? Is it French?

I am looking forward to your feedback and clarification.

Thank you and Kind regards,
Ram

Luca Kainzner September 16, 2024

Hey Ram, 

I got news - we have a different use case at all. The sum of the customfields fields (linked to epic's) should be shown in advanced roadmaps

image.png

I guess I have to open a new question

0 votes
Mehmet A _Bloompeak_
Atlassian Partner
September 6, 2024

Hi @Luca Kainzner

Welcome to the Atlassian Community!

If you prefer using a marketplace app, you can try Sum Up Reports for Jira app developed by our team. This app provides various table reports based on the fields you choose.

  • You can list the issue fields you want and sum up the values at the bottom.
  • You can group your data on any field (sprint, status, assignee, component, project etc.) and sum up the field values (story points, time estimate etc.) or take averages.
  • You can add this app as a gadget to your Jira dashboards.

Here is our live demo dashboard where you can see and modify any sample report and play with it.

For further details, you can have a look at Sum Up and Average Reports in Jira Dashboards article.

If you have any questions, feel free to schedule a demo with us.

 Hope it helps.

Luca Kainzner September 8, 2024

Thanks, unfortunately we use DataCenter and this App is just available in the cloud. 

0 votes
Marc - Devoteam
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.
September 6, 2024

Hi @Luca Kainzner 

Welcome to the community.

You should also be bel to do this via an automation rule.

You can use smart values to make the calculation.

See documentation here: https://confluence.atlassian.com/automation/jira-smart-values-math-expressions-993924866.html 

TAGS
AUG Leaders

Atlassian Community Events