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

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

This widget could not be displayed.

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.

This widget could not be displayed.

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

533 views 3 19
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you