Misc Custom Fields - Display version release date in issue

I've read the documentation, but I haven't found the syntax for the formule to display the fixversion release date for the issue. Is this possible with this plugin ?

(I will enforce only one fixversion for the issues)

4 answers

1 accepted

Ok, the correct (and tested) formula is:

<!-- @@Formula: 
Collection versions = issueObject.getFixVersions();
if (versions==null || versions.size()!=1)
  return null;

version = versions.iterator().next();
return version.getReleaseDate(); 
-->

David, thanks a lot! it works great, however it displays only: "in 4 months"

Can we force it to display the real date ?

Also if you could get chance, could you take a look at my other question ?

https://answers.atlassian.com/questions/240342/how-to-copy-the-sprint-name-into-another-field

Although I can't test it right now, I'd say you could create a Customer Date/Time Field with the following formula:

Collection<Version> versions = issueObject.getFixVersions();
if (versions==null || versions.size()!=1)
    return null;
Version version = versions.iterator().next();
return version.getReleaseDate();

Thanks David, I've tried running your suggestion using the Misc Custom Date/Time

<!-- @@Formula: Collection<Version> versions = issueObject.getFixVersions();

if (versions==null || versions.size()!=1)

return null;

Version version = versions.iterator().next();

return version.getReleaseDate(); -->

My field is not getting shown on the screen where it's supposed to be.

Look inside atlassian-jira.log for errors. (look for com.innovalog.jmcf)

[innovalog.jmcf.fields.CalculatedDateField] CalculatedDateField: error evaluating formula: Parse error at line 1, column 31. Encountered: =

It's probably because of "Collection<Version>". Try replacing that with just "Collection".

Hi David, the method you suggested works great, but I'm running into an issue with re-indexing when the Release Date value is updated on the Version.

Currently, if I update the Release Date value on the version it's not re-indexed until I manually update the issues linked to the release.  Is there anyway to get the ticket re-indexed when the Release Date value is changed?

Unfortunately, that's a limitation of JIRA - there is no mechanism in place to track dependencies between fields and the objects they depend on. Also, there is no way to run code when a version object is updated. 

However, you could try automating a full reindex every night for example. 

David 

Hi Gregory,

I can't help with displaying it on the issue page in JIRA, but if you only need it in a report on the issue, check out Intelligent Reports. It can easily show any aspect of the version in a report on the issue. Best of all it's quick and simple, design your template in Microsoft Word, and set up simple point and click rules to fill in the data - no programming language or API to learn.

Unfortunately, the date is displayed using JIRA's default settings.

If you want custom formatting, you need to create a Text field instead - but of course this won't be searcheable or sortable as a string then...

I believe I could make an improvement to the calculated Date/Time fields to support selecting a different formatting option (I'll need to chek though), but this would require some work. Can you post an enhnacement request on our JIRA?

David Fischer I saw that this was resolved in https://innovalog.atlassian.net/browse/JMCF-102. I have version 1.5.11 of the plugin which I believe to be the latest but the <!-- @@Format: DATE --> isn't working for me. Wasn't able to comment in the jira project sorry for putting it here.

Well, you're not giving me much to work from... Any error in the logs (atlassian-jira.log) right after you try to display an issue that has your field?

Sadly none that are in regards to this problem, I have a few errors showing in the log but they are related to the custom text fields, which I expect them to show up currently. My jira version is currently 6.1.6

Can you share your definition ("Description") of the custom field?

<!-- @@Formula: date = issue.get("customfield_11032"); num = issue.get("customfield_11031").intValue(); org.apache.commons.lang.time.DateUtils.addWeeks(date,num); --> <!-- @@Format: DATE -->

Unfortunately, you are right. This is due to an "improvement" in JIRA 6, that displays dates "smartly". For example, it will display "just now" for a date that represents now, but it will automatically update (without any user action) every minute, to display "one minute ago" a minute later. You should create a new issue on our issue tracker: https://innovalog.atlassian.net so that you can track its resolution, and I will try to fix it in the next release.

thanks hadn't gotten around to it yet

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published yesterday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

60 views 0 3
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