Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,367,525
Community Members
 
Community Events
168
Community Groups

Need help with script for calculate and average

Hi Team,

I need help 

I have parent issues task under task i have links contains in issues in that link issues i have some calculated number field.

for ex in 1 task i have 60 and task 2 i have 90 both values need to calculate and average the fields and the average value need to display in parent.

xyz ----parent issues

Link conatins in 

1 task  child  ---- number 60

2  task child ----- 90

60+90=150

average 150/2=75

the value 75 need to display in parent xyz field.

 

please help me how to write  script for this

 

2 answers

1 accepted

0 votes
Answer accepted

We need to know what app is providing the place for you to do the scripting.

We can assume you are using Jira as the application, as you're talking about issues, and in there I can tell you that you need to use a scripted field or listener to do the work, but Jira does not have any scripting functionality, so you need an app to add some, and before we can give you any scripts, we need to know which one you are going to use.

we are using script runner app

https://library.adaptavist.com/entity/calculate-the-sum-of-all-values-of-a-custom-field-in-linked-issues is a script that does most of what you want and is easy to add an "average" step to.

0 votes

Hi @Madhu ,

which app are you using for that?

i need to write script for this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events