"Custom Formula" to calculate a date
Asked by Sofia Rios:

I need to calculate a date field using another date field:

For example:  

Launching Date = Delivery Date + 7 days

So when someone adds the "Delivery Date", automatically the "Launching Date" field is calculated.

Is this possible?


Answers:
author: Daniel Naumann
body: Hi Sofia,

An Atlassian team discussed how they used JPD and included the automation details on how to create a date in the future (+ X days) - <https://community.atlassian.com/t5/Jira-Product-Discovery-articles/How-one-team-in-Atlassian-uses-Jira-Product-Discovery/ba-p/2452156>  

You'll want to check out part 3. I'm sure you can modify it to achieve your goal.

comments: author: Sofia Rios
body: Thank you!! This works :)


author: Daniel Naumann
body: Oh, something to watch out for [@Sofia Rios](/t5/user/viewprofilepage/user-id/1219999) , is that any calculations the automation does (like triggering an action based on the date) are based on UTC time, but actions _you_ take are based on your timezone set in your profile.

It took me days to figure out why my automation wasn't triggering at the right time!


author: Rachel Sweeney
body: [@Sofia Rios](/t5/user/viewprofilepage/user-id/1219999) Would you be willing to share your final solution and formula? Did you create a calculation field or use an automation? I have a slightly different use case but I think the method would be similar to what you were doing; I'm trying to calculate the age of an idea based on the number of days that have passed since it was created.


author: Pieter Helsen
body: Hi,  

I would use an automation for that.

See my example below:

![Screenshot 2024-03-15 093920.png](https://community.atlassian.com/t5/image/serverpage/image-id/312290iF1FDB0B98BE38CE1/image-size/large?v=v2&px=999 "Screenshot 2024-03-15 093920.png")

Disclaimer: I did not activate and test the rule, but something similar should work.

Have a look at the Automation documentation if it doesn't work:

[Jira smart values - date and time \| Cloud automation Cloud \| Atlassian Support](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/)

comments: author: Hermance NDounga
body: I don't think this workaround would work because date fields don't have this format in Jira Product Discovery :/   
But then maybe using it it JSW and then grab this date to Jira Product Discovery


author: Sofia Rios
body: Thank you for your response. I tried it, but it didn't work. It doesn't show me the fields I need to update (custom fields).


author: Hermance NDounga
body: Hi Sofia,

Formula fields cannot calculate dates.

If Pieter workaround works, I suggest you create this rule in your Jira Software project, so you get both dates, the Launching date and the Delivery date in Jira Software.

Then you create a date field in Jira Product Discovery and you select "Ovveride values" in the field configuration, and you grab the value "Launching date" from Jira Software.

If you can try it out, let us know if it worked!

Cheers,

comments: author: Sofia Rios
body: Thank you for your response. I tried Pieter's suggestion and it didn't work.

The issue is that both dates are custom fields **within** Jira Product Discovery. It's sort of a GTM pipeline, so I really can't connect to Jira Software.


Tags: custom-formula

jira-product-discovery