Hi all,
I want to calculate the sum of progress (script field) in the board.
I have already made "Progress(script fields)".How can I get the total of this?
Is it possible?
Hi @jypark ,
beacuse of scripted fields are calculated on view (there are no values stored), you need to recalculate sum of all other progress fields into your "Total" scripted field.
Ciao,
Fabio
In theory, you could use a script to get the values from scripted fields and add them up.
In reality, you must not do that on the same issue because the calculations are not done in the same order - a value that uses another scripted field may be being calculated before or after you have calculated the field it is relying on.
The other problem you have is that fields belong to issues, not boards. So you cannot create a field like this, you would need to write code that amends the boards to include your field.
Hi @Fabio Racobaldo _Catworkx_
Thank you for your reply.
if that is possible, how should I make script?
I need a "Total" scripted field are calculated by project(board).
can you make it?
I made it but it is not working and it is not working by board.The script below is something I made.
//////
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.CustomFieldManager
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()List<String> fieldNames = ["Progress"]List<Integer> scores = []for (String field : fieldNames){def cf = customFieldManager.getCustomFieldObjectByName(field)scores.add((Integer) issue.getCustomFieldValue(cf)?: 0)}return scores.sum {it}
Thank you.
Regards,
jiyeon Park
Hi, @Nic Brough -Adaptavist-
Sorry for my late reply.
How about utilize the "progress (script field)"?
ex) if Progress(Script Field) != null
else sum
please check the script of another reply!
Jiyeon Park.
No, do not do that. That is exactly what I said you should not do.
You're tossing a coin as to which script runs first. The script you've given here could return the wrong result if the progress field changes in the same change.
oh. I understand. Thank you!
Can i try that in a way that doesn't reference other script fields?
ex) if Original Estimate(by board) != null
else sum.total original estimate(by board)
return total progress = (total original estimate / total original estimate) * 100
How about this?
however, i cannot create a script. I don't know the script.
It looks like you're new here. Sign in or register to get started.