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)
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Another question, how can I also get the Release Start Date?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Got it working with:
version.getStartDate();
It does have to be capitalized as shown.
Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
[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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where in JIRA do I enter these, so that I can set my Due Date to auto-populate from my Fix Version release date?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Casey,
That's a very different type of requirement, one that would be implemented using a workflow post-function such as JMWE's Set Field Value post-function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Look inside atlassian-jira.log for errors. (look for com.innovalog.jmcf)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
[innovalog.jmcf.fields.CalculatedDateField] CalculatedDateField: error evaluating formula: Parse error at line 1, column 31. Encountered: =
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's probably because of "Collection<Version>". Try replacing that with just "Collection".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Humming along for a few years, then hit the issue with Multiple FixVersions for a given Issue. Modified the Customer Field (JMCF) to handle:
Collection JIRAversions = issueObject.getFixVersions();
if (JIRAversions==null)
return null;
Date TodaysDate = new Date();
Date SaveDate = null;
Date PullDate = null;
Iterator iter = JIRAversions.iterator();
// Release date is the Next Release Date. Once all Releases are past, then it is the oldest date.
while (iter.hasNext()) {
version = iter.next();
PullDate = version.getReleaseDate();
if (!(PullDate == null))
{
if (SaveDate == null)
SaveDate = PullDate;
if (PullDate < SaveDate && SaveDate < TodaysDate)
SaveDate = PullDate;
if(PullDate > TodaysDate && PullDate > SaveDate && SaveDate < TodaysDate)
SaveDate = PullDate;
}
}
if (SaveDate==null)
return null;
// The next part is so I can set the Release Date to 5pm.
Calendar cl = Calendar. getInstance();
cl.setTime(SaveDate);
cl.add(Calendar.HOUR,17); //Set to 5pm
JiraReleaseDate = cl.getTime();
return JiraReleaseDate;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you share your definition ("Description") of the custom field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<!-- @@Formula: date = issue.get("customfield_11032"); num = issue.get("customfield_11031").intValue(); org.apache.commons.lang.time.DateUtils.addWeeks(date,num); --> <!-- @@Format: DATE -->
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've created https://innovalog.atlassian.net/browse/JMCF-148 for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.