Forums

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

calculated Date (created date + to be started by days)

Sandy February 21, 2022

How to calculate this

 

Created date + To be Started By (30/60/90 Days) = Potential Start Date

2 answers

0 votes
Alex Koxaras -Relational-
Community Champion
February 21, 2022

Hi @Sandy  and welcome to the community!

You can use smart values to do that and especially the {{[date].plus[Unit]([number])}} which I've highlighted on my link. It's pretty easy to do so via Jira Automation.

Or you can use and app to do that, like JSU, or scriptrunner which have calculated fields.

0 votes
Sachin Dhamale
Community Champion
February 21, 2022

@Sandy ,

Welcome to the Atlassian Community

You need to use date function where you can add created date with number of days which will give the future date.

Use this groovy script on Postfunciton for this you will need script runner plugin. I am assuming you are using server instance 

 

import java.util.GregorianCalendar;
import java.util.Calendar;
import java.util.Date;
import java.text.SimpleDateFormat

SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd HHmmss.SSS");
// the initial date format is "yyyyMMdd HHmmss.SSS" despite the original data being in the format "yyyy-MM-dd" 
// because of the special internal date format when using a map in boomi
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");
// is the date format you want the output to be in
Calendar c = Calendar.getInstance();
c.setTime(sdf.parse(inputDate));
c.add(Calendar.DATE, 30);
// number of days to add, 30 days in this case
outputDate= sdf2.format(c.getTime());

 

If you wanted to subtract days, you would use a negative number instead:
 

c.add(Calendar.DATE, -30);
// number of days to subtract, 30 days in this case

 

Accept the Answer if it helps

Suggest an answer

Log in or Sign up to answer