Calculated Misc Date Field

Janet Buckley November 12, 2018

Hello, I have the misc custom field pluigin and I am trying to create a custom date field to display the end date of a release/version. I am not able to get it to work and also I am not able to see the field on the screen. On where is my field it says it is present but it is not. I need to be able to report by release date. All the community posts don't work.

Thanks

1 answer

0 votes
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 13, 2018

Calculated fields will only appear if they have a value and didn't throw an exception during their calculation. My guess is the formula you used contained errors, which you can see in the Jira logfile (atlassian-jira.log).

When you say you want to display the end date of a release/version, which version are you talking about? The Fix Version/s of the issue? And what if there are multiple fix versions?

Janet Buckley November 13, 2018

Thanks David for your help. 

Yes I am trying to get the release end date of the fixed release associated with the issue. We have to do some reporting by date released into PRD and I have no way to do that. I will see if I can get access to the log. I have tried a couple different formulas I got online but nothing is working.

Janet Buckley November 13, 2018

This was one of the formulas I tried enableCache = {-> false}
def version = issue.getFixVersions()
version.first().getReleaseDate()

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 13, 2018

While JMCF 2.0, which is just around the corner, will switch to Groovy, JMCF 1.7 still uses the BeanShell language, which is closer to Java 1.1. So the code you tried, which uses Groovy-specific syntax, will not work.

Try this:

<!-- @@Formula:
versions = issueObject.getFixVersions();
if (versions.size() > 0)
  return versions.get(0).getReleaseDate();
return null;
-->
Janet Buckley November 19, 2018

Hi David, we have just updated to latest version of Jira 7.12.3. I have tried the formula above and I still do not see the field or any values on my issue for an issue with fix release with end date.

Thanks

jira misc custo.PNG

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 19, 2018

Hi Janet,

the configuration seems correct though, and I did test the formula and it worked just fine.

Are you looking at the Issue View screen or the result of a search? Because if the latter, you'll first need to reindex Jira.

Did you use "Where is my field" again after modifying the formula?

Janet Buckley November 19, 2018

Hi David, I am looking at issue screen

Here you have issue with fixversion and below it tells me the field is on the screen but it is not!!

deployed.PNGadate.PNG 

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 19, 2018

Date fields are all grouped together on the right of the issue view. I don't see the date section on your screenshot, did you check there?

Janet Buckley November 19, 2018

Hi David, You totally clutched it. I didn't even think to look at the date section I was in the edit screen.

It's working GREAT.

Thanks a LOT.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events