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

This widget could not be displayed.

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

I know this is an old but I tried the formula above and the field is not getting shown on the screen where it's supposed to be.

Does this formula work with latest Misc Custom Fields and Jira Server 7.8?

Yes, it does. However, I had to update my initial response because the code what somewhat garbled by the conversion from answers.atlassian.com to community.atlassian.com.

Also, note that it only works if you have a single fix version on your issue.

Hi David,

Works great thanks!

Hi David,

Another question, how can I also get the Release Start Date?

Hi David,

Got it working with:

version.getStartDate(); 

It does have to be capitalized as shown.

Thanks again.

[Sorry, missed the previous posts. Disregard this answer that I can't delete]

Hi Gary,

start date and release date are two different things though.

This widget could not be displayed.

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

Collection&lt;Version&gt; 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 

This widget could not be displayed.

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.

This widget could not be displayed.

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
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...

510 views 3 18
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