Jira Misc Custom Fields calculated date (add days)



I have installed the Misc Custom Fields add-on for Jira, but need some guidance on the correct formula to use to produce a date that is X days after another date field.


For example, if an email was sent on 1/1/17, the response would be due 14 days later, and I would want the calculated field to show 1/15/17.


Any suggestions?





3 answers

I need some assistance with this too, did you find a solution by any chance?

Nothing with this add-on.  I did see that the (paid) Jira Workflow Toolbox add-on appears to have this functionality (on a transition), but I haven't had a chance to test.



There seems to be another which seemed to work for me. 


Get this add on: Jira Misc Workflow Extensions

And then on post functions you can do update field and select the custom date field you have created in this scenario "Lead time target date" and write the below

Lead time target date: {{ now | date('add', 14, 'days') | 'date') | date }}


This should populate the field but it is based on created date of the issue. 

Hi Kirti,

the syntax you provided is for Jira Cloud. On Jira Server, the syntax would be different:

new Date() + 14

As for JMCF, this is how you would do it. Imagine the field that holds the email date is called "Sent On":

if (issue.get("Sent On") == null)
return null;
return new Date( issue.get("Sent On").getTime() + 14*24*3600*1000 );

Here's how it works: it returns a new Date object from milliseconds calculated from the milliseconds in the Sent On date + 14 days x 24 hours x 3600 seconds * 1000 milliseconds.

Oh yes sorry I forgot to mention it is for the cloud version. Thank you for giving the server version info

Well, I knew it had to be on Jira Server because JMCF is only available for Jira Server, not Cloud...

I have confirmed this works!

Suggest an answer

Log in or Join to answer
Community showcase
Emilee Spencer
Published Feb 23, 2018 in Marketplace Apps

Marketplace Spotlight: DeepAffects

Hello Atlassian Community! My name is Emilee, and I’m a Product Marketing Manager for the Marketplace team. Starting with this post, I'm kicking off a monthly series of Spotlights to highlight Ma...

330 views 2 5
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot