Forums

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

Date calculation in Jira Structure formula

Mary M August 4, 2022

I am trying to create a Jira Structure Formula field that tells me if a date in a custom field is older than 30 days from today. 

I can get today's serial number and add 30 days of seconds to it, but when I try to take this little formula (today()+2592000) and use it anywhere else, it doesn't work as expected. I can do this:  format_datetime((today()+2592000),"dd-MM-yy") and it gives me today's date.  Taking out the addition gives the same result.

I have tried a number of different formulas and ways to break it down, with no luck.

Any ideas?

 

 

 

1 answer

2 votes
David Niro
Atlassian Partner
August 4, 2022

Hello @Mary M ,

David from ALM Works here.

For this, it is going to depend on what custom field you are using.  If you are using a Date Picker custom field, it will be as I describe below.  If you are using some other custom field type, or a custom field coming from another app, please let me know what that field is / where it comes from.

If using a Date Picker custom field, we will want to use the DAYS_BETWEEN function, defining your custom field and today(), then compare the "days between" to the 30 day threshold you have set.

It will look something like this:

IF DAYS_BETWEEN(today(),DatePicker)>30: 
"oh no"

You can change the "oh no" to match whatever text you would like to display.  

I should also mention that the formatting of the formula will depend on which version of Structure you are currently on.   This format works with 7.0 and higher.  You can determine which version of Structure you are on by clicking on the info button in the bottom right corner of your structure.

Please let me know if this helps.

Best,
David

Alex Agn
Contributor
June 4, 2023

 @David Niro  would your suggestion also work With the Jira “updated” field ? 
(The field registers the date &time of the last change/update to the issue)

meaning

 

IF DAYS_BETWEEN(today(),Updated)>”xxx”

Number of days since last update of a  e.g. Epic.

 

thanks

Like David Niro likes this
David Niro
Atlassian Partner
June 5, 2023

Hello @Alex Agn ,

Yes, it works with the updated field.  You would want to switch the updated and today() variables though.

Best,
David

Sanjivani Wayal
Contributor
September 26, 2023

Hi @David Niro , Is there a way to compare 2 dates of different issuetypes linked in formula in structure

Suggest an answer

Log in or Sign up to answer