Calculated number field based on Status

Marc Jason Mutuc
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 14, 2016

This is my current script :

 

<!-- @@Formula:
if (issue.get("Dev - Actual Effort Hours") == 0 )
return 0;

return (issue.get("Dev - Actual Effort Hours") /
(issue.get("Dev - Actual Effort Hours") + issue.get("Dev - Balance To Go Hrs")));
-->

<!-- @@Format:
return numberTool.format(Math.round(value*100))+" <b>%</b>";
-->

 

But I would like to set the return output to 100% when the Status goes to / has been to "Dev Completed".

 

Any help would be greatly appreciated.

1 answer

1 accepted

0 votes
Answer accepted
David _old account_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 14, 2016

Why don't you simply clear the "Dev - Balance To Go Hrs" field when you reach the "Dev Completed" status?

Otherwise, you'll need to create a field that will "remember" that the issue went through the "Dev Completed" status at some point, and use that field in an if statement.

Marc Jason Mutuc
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 15, 2016

Hey David! Dev - Balance To Go Hrs is a calculated field which is the difference between Estimated and Actual. We don't want this changed as this will give us data on how estimates are being done.

Thanks for the inputs! I'll try to use a flag as suggested.

Just wanted to try and check if its doable in another way. smile

David _old account_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 15, 2016

Ok, makes sense.

BTW, the field that "remembers" that the issue went through the "Dev Completed" status could also be a calculated field such as a Transition Date/Time or User field (if it's null, it means the issue never went through any of the specified transitions).

Marc Jason Mutuc
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 16, 2016

Yes. But I went and use a text field instead just in case it needs to be more flexible.

Suggest an answer

Log in or Sign up to answer