Was does calculated field result not show result on filter screen?

Jenny Bellas March 10, 2015

I have a calculated number field called EAC (estimate at completion) with script:

Double eac
if (issue.estimate) {
    if (issue.timespent) {
        eac = ((issue.timespent + issue.estimate) / 3600)
    }
    else {
        eac = issue.estimate / 3600
    }
}
else {
    return 0 as Double 
}
return eac

This calculated column returns the correct value on the view issue screen, but has a blank value on the filter issue screen if the calculation is eac = ((issue.timespent + issue.estimate) / 3600). I think it has something to do with issue.timespent but am unsure how to correct this, especially since it displays correctly on the individual issue. Thanks for the help!!

screen-print-1.png

2 answers

0 votes
Jenny Bellas March 11, 2015

Hi Jozef - Thanks for your response. I had made sure to re-index. I was able to fix the issue though. It did end up having to do with the issue.timespent value. I change my code so those referenced issue.getTimeSpent() instead and everything worked perfectly after that! Code that works is copied below.

Double eac
if (issue.estimate != null) {
    if (issue.getTimeSpent() != null) {
        eac = ((issue.getTimeSpent() + issue.estimate) / 3600)
    }
    else {
        eac = issue.estimate / 3600
    }
}
else {
    return 0 as Double
}
return eac
0 votes
Jozef Kotlár
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.
March 10, 2015

Are you sure that all your issues were re-indexed? Values shown in navigator are actually read from lucene index, not calculated immediately as in issue view.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events