Forums

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

jql function to return number of days and time.

Marija Ušakova February 28, 2018

Hi,

I created a scripted field (datelastfilled) to return a time stamp on a custom field. Now I need to create a query with system date and time - datelastfilled.

Like whats the jql query for currentDateTime? and how do I do minus operation so i can get this down below.

Ex : datelastfilled returns this 2017-05-19 13:05:25.0.

i need jql like   datelastfilled - currentDateTime = total days and hh:mm:ss.

 

1 answer

0 votes
Marija Ušakova February 28, 2018

Can anyone point out to solution.

Alexey Matveev
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.
February 28, 2018

 

You would need to rewrite your query. For example, suppose you want a query like this

currentDateTime - datelastfilled = 5m

Your query could be rewritten like this

datelastfilled > now() - 5m and datelastfilled < now() - 4m

 You can not find difference up to seconds. only up to minutes, hours, days, weeks.

Marija Ušakova March 1, 2018

But my scripted field is not a date picker here, but i had to choose multi text field option because it was giving me $datePickerFormatter.format($value) when its selected as date picker, but when its selected as multiline text its exactly returning the timestamp.

 

Alexey Matveev
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.
March 1, 2018

If it is not a date picker then you have to write your own JQL function, unfortunately

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events