Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner for JIRA fromNow

Daz Daz January 10, 2019

Hi guys,

I'm trying to beautify dates or simplify or whatever you call it. Instead of showing absolute datetime like 2019-01-01T08:00:00, it would be better if I show 5 days ago or Yesterday or 5 minutes ago and the likes. 

I am using Scriptrunner for JIRA and it is using groovy scripts. For .net I can use moment.js but not too sure for groovy script. If possible I do not want to do it the hard way and have hundred lines of code/logic just to translate absolute datetime to relative datetime. 

Any kind soul knows how to do this?

1 answer

0 votes
Sid
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 11, 2019

hi @Daz Daz,

  1. Shut down your JIRA applications
  2. Navigate to $JIRA_HOME
  3. Edit the file: jira-config.properties
  4. modify the following line:

    jira.lf.date.relativize = true
  5. Save the file

  6. Restart your JIRA applications

 

this should bring back what you are looking for, Let me know if this solves

Daz Daz January 11, 2019

Thanks for the reply but it is not what  am looking for. I do not intend to relativize all the datetimes in jira. I only want certain datetime/field/values to be relative dates.

 

I am currently using Scriptrunner for JIRA to make a custom field. I currently have a datetime value like 2019-01-01T08:00:00 and I want to relativize it and display the value on that custom field so that it appears as 5 minutes ago for example. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events