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

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.

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

143 views 0 4
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