JIRA Release notes Velocity template: How to get current date and time? Edited

Using JIRA Server 7.3.2

In my release notes, I'd like the current date and time at the bottom. E.g. just to echo out "2017-09-28T12:45" for example. 

Is that possible using the Velocity templates? I know how to edit the template and all - so I'm just after the syntax / method on how to obtain the current date and time. Preferred also if there is an UTC variant?

 

1 answer

This widget could not be displayed.

You don't really do it in velocity, you call out to Java to do it.

From memory, start with $dateUtil.getCurrentDate()

Thanks Nic,

I actually tried this already - but it just renders like this:

Release notes generated $dateUtil.getCurrentDate()

So it doesn't "execute" the java call. I guess that means dateUtil is not in the current VelocityContext.

Docs are not that good as to what context classes I have access to :(
Any pointers?

BTW: I've also been trying the docs here. There it is called "dateutils". I've also tried the link to JIRA 3.6.x and later, but that points to Email context. very confusing. In any case - whatever I try, it is just rendered as text.

Ran into similar issues, Werner. You are not alone.

I wonder what is in the Velocity context for Jira's release notes.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 16 hours ago in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

42 views 1 0
Join discussion

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