Summation of aggregateExpression field values (Adaptivist ScriptRunner)

Mikhail December 30, 2019

Hi guys,

I want to calculate story points number separately for Devs, SQAs and DevOps by JQL in quick filter. So, there are customfield_1 for total ticket estimation (dev+sqa or devops+sqa) and customfield_2 for SQA estimation only. Devops tickets are marked by DevOps label

Expression for Devs and SQAs works good:

[CSU1-1317] Change DCAT report screens - Align JIR.png

sprint in openSprints() AND labels not in (DevOps) AND issueFunction in aggregateExpression("Total Story Points", "customfield_1.sum()", QA, "customfield_2.sum()", DEV, "customfield_()-customfield_2.sum()") OR sprint in openSprints() AND labels is empty AND issueFunction in aggregateExpression("Total Story Points", "customfield_1.sum()", QA, "customfield_2.sum()", DEV, "customfield_1.sum()-customfield_2.sum()")

 

However if I try to sum up story points for DevOps additionally , ScriptRunner will summarize all tickets in sprint despite the label value and won't show Dev value, because it's missed in last condition

[CSU1-1320] Promote the new deploy project (u1-tpu (2).png

sprint in openSprints() AND labels not in (DevOps) AND issueFunction in aggregateExpression("Total Story Points", "customfield_1.sum()", QA, "customfield_2.sum()", DEV, "customfield_()-customfield_2.sum()") OR sprint in openSprints() AND labels is empty AND issueFunction in aggregateExpression("Total Story Points", "customfield_1.sum()", QA, "customfield_2.sum()", DEV, "customfield_1.sum()-customfield_2.sum()") OR sprint in openSprints() AND labels in (DevOps) AND issueFunction in aggregateExpression("Total Story Points", "customfield_1.sum()", QA, "customfield_2.sum()", DevOps, "customfield_1.sum()-customfield_2.sum()")

 

Also I tried to add DevOps field to previous conditions with zero value but nothing changed

[CSU1-1320] Promote the new deploy project (u1-tpu.png

sprint in openSprints() AND labels not in (DevOps) AND issueFunction in aggregateExpression("Total Story Points", "customfield_1.sum()", QA, "customfield_2.sum()", DEV, "customfield_()-customfield_2.sum()", DevOps, "customfield_1.sum()-customfield_1.sum()") OR sprint in openSprints() AND labels is empty AND issueFunction in aggregateExpression("Total Story Points", "customfield_1.sum()", QA, "customfield_2.sum()", DEV, "customfield_1.sum()-customfield_2.sum()", DevOps, "customfield_1.sum()-customfield_1.sum()"OR sprint in openSprints() AND labels in (DevOps) AND issueFunction in aggregateExpression("Total Story Points", "customfield_1.sum()", QA, "customfield_2.sum()", DEV, "customfield_1.sum()-customfield_1.sum()"), DevOps, "customfield_1.sum()-customfield_2.sum()")

 

Do you know some hints for this Use Case? Thank you!

1 answer

2 votes
Luis Tellado December 2, 2021

After updating to Scriptrunner DC 6.40.0 is seems that the Story Points sum has stopped working?

issueFunction in aggregateExpression("Total points", "StoryPoints.sum()")

Thanks! 

Sylvain Leduc December 17, 2021

Indeed, that's why I came here !

So I just noticed they released a new v6.40.1 :)

https://docs.adaptavist.com/sr4js/6.40.1/release-notes/release-6-x#id-.Release6.xv6.40.1

Like Luis Tellado likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events