Setting the due date


I'm junior in JIRA. Could somebody help to resolve the following task?

I need to preset the due date=creation date+3 days for one project.


2 answers


I think You can do it using a script in the post function JJUPIN or JPython.

Or in the screen transition in javascipt


As a "screen transition" do you mean transition's post function. Have you got any script example?


There are some transitions that have no screen, so we use some scripts in the post-transition function as JJUPIN or another scripting plugin (#{dueDate}=#{created}+3d)

With javascript , you put this script in your description field duedate

var bb = new Date();
var cc = new Date();

0 votes

Hey Irina, seems like there has been a discussion on this before. You can get it to work using Behaviour Plugin. You can read more about it in here.

Thank you! A little bit more...

I've tried to run this script:

import java.sql.Timestamp

import com.atlassian.jira.issue.MutableIssue

// initializing the priority

def BLOCKER = 1;

def CRITICAL = 2;

def MAJOR = 3;

def MINOR = 9;

def Trivial = 30;

// calender which returns the date according to the priority defined

private GregorianCalendar getDate(double roll){

Calendar cal = Calendar.getInstance();






for (int x=0;x<roll;x++){



return cal;


MutableIssue mutableIssue = (MutableIssue) issue;

def priority = mutableIssue.getPriority().getString("name");

def setDueDate = mutableIssue.getDueDate();

//only set the dueDate if the date isn't already set (i.e. if it == null).

GregorianCalendar cal;


cal = getDate(CRITICAL);

} else if(priority.equals("Augsta")){

cal = getDate(MAJOR);

} else if(priority.equals("Vidēja")){

cal = getDate(MINOR);

} else if(priority.equals("Zema")){



Timestamp dueDate = new Timestamp(cal.getTimeInMillis());



but in the log file I've found the following:

2013-05-23 17:35:33,892 http-bio-8080-exec-12 ERROR isolarcu 1055x7733x1 1aixvvg /secure/QuickCreateIssue.jspa [onresolve.jira.groovy.GroovyFunctionPlugin] Error executing post-function

javax.script.ScriptException: javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method getTimeInMillis() on null object

at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(

In the discussion link I've provided above, discussed about the similar error as well. You can scroll down a bit or try CTRL+F for "Cannot invoke method getTimeInMillis() on null object" on the link.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,197 views 5 10
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