Forums

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

How to get sum of the custom field value for one issue type

kk4065896 September 12, 2022

Hi all,

 

I have the custom field called ‘Number of Reads’ and associated with ‘user inter’ issue type. I created number field called ‘Avg.No.Reads’. I need files value based on the following formula.

Avg.No.Reads= Sum of Cf for issue type/no.of issue that ‘Number of Reads not empty of issue type.

Example1- when issue type have 3 issue have the custom fields values like 1,5,6 then ave.no.reads is 1+5+6/3=4.

 

could you help me how can I achieve this through scripted field. Thanks in advance.

Regards.

Kumar

1 answer

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
September 13, 2022

Hi @kk4065896,

I'm not sure if a custom field is the right tool for the job, as every custom field value is  stored "on" a particular issue, and I wouldn't know what issue you'd want to store the "Avg.No.Reads" on? 

For a completely different direction, if you are open to solutions from the Atlassian Marketplace, you could generate your result with just a few clicks in the app that my team is working on, JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issue that allows viewing, inline-editing, sorting and filtering by all your issue fields, including custom fields. You can also group your issues (e.g., by issue type), and calculate sum-ups across these groups of issues (e.g., the average). So what you could do is,

  • create a so-called sheet in JXL that includes all your "user inter" issues,
  • add the "Number of Reads" field to your sheet as a column, and configure it to use the average for sum-ups,
  • enable sum-ups for your sheet.

This is how it looks in action: 

avg-custom-field.gif

(As it seems that you're on Jira Server: While JXL is not listed for Server on the Marketplace (since Server is discontinued, new apps can't list on the Marketplace anymore), it is perfectly compatible; it's just that we need to generate a trial license. Just let me know if you're interested and I'm happy to generate a free trial license for you.)

Best,

Hannes

Suggest an answer

Log in or Sign up to answer