Here an example code to set DueDate = Today + 1 using a PostFunction of Scriptrunner for Jira Cloud

//Here the imports to use classes for Time and Dates
import java.text.SimpleDateFormat
import java.sql.Timestamp
import java.text.DateFormat
import java.util.Date

//we set in the new variable duedate the value of the Duedate of the issue
//Date duedate = issue.fields.duedate

//To get the actual DATE
Date tomorrow = new Date() + 1
def tomorrow_new = new Date().parse('yyyy-MM-dd', tomorrow.format('yyyy-MM-dd').toString()).format('yyyy-MM-dd');

//We are setting the new due date
issueInput.fields.duedate = tomorrow_new

Here more examples to work with Dates in Jira Server, Datacenter & Cloud:

By MrAddon

Posted by:.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s