Forums

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

how to get the sum of custom field for all issues in a project

Karim Belhadj
Contributor
December 27, 2018

I have a custom field (Number) in any issues , so i would like to get the sum of this custom field for all issues.

 

 

Regards

1 answer

0 votes
David Fischer
Community Champion
December 27, 2018

Where would you like to get that sum? On a dashboard gadget? From the REST API? Somewhere else?

Karim Belhadj
Contributor
December 27, 2018

@David Fischer , no i mean in script runner , scripted field . 

 

Regards

David Fischer
Community Champion
December 27, 2018

Scripted fields, like all custom fields, are associated with issues, and therefore calculated for each issue. Here, you want a sum across all issues. You want the same sum to be displayed on every issue?

Also, it'll be a costly operation which will be done for each issue view or modification. Not sure that's a great idea...

Karim Belhadj
Contributor
December 27, 2018

@David Fischer i have a custom field inside every issue , i want to get the sum of thees fields for all issues.

fo each issue i wana to get the value of the custom field and add it . to get finally the sum.

 

Regards

David Fischer
Community Champion
December 27, 2018

I understand that. But the Scripted field will be an additional custom field whose value will be calculated every time an issue is displayed or updated - and it will sum up the values of the source custom field over every issue. So the same sum will be calculated for every issue. 

David Fischer
Community Champion
December 27, 2018

Also, you need to know that the value of Scripted fields is not stored in the Jira database. It's calculated on the fly. 

Karim Belhadj
Contributor
December 27, 2018

@David Fischer i will use a listener for that just I need the code how to loop all issues to get the value of custom field for every issues and sum up . 

Regards

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events