Hi,
I think You can do it using a script in the post function JJUPIN or JPython.
Or in the screen transition in javascipt
Thanks,
As a "screen transition" do you mean transition's post function. Have you got any script example?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
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();
cc.setDate(bb.getDate()+3);
calendar.setDate(cc);
calendar.callHandler();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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();
cal.setFirstDayOfWeek(Calendar.MONDAY);
cal.set(Calendar.HOUR_OF_DAY,0);
cal.set(Calendar.MINUTE,0);
cal.set(Calendar.SECOND,0);
cal.set(Calendar.MILLISECOND,0);
for (int x=0;x<roll;x++){
cal.add(Calendar.DAY_OF_MONTH,1);
}
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;
if(priority.equals("Kritiska")){
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")){
cal=getDate(Trivial);
}
Timestamp dueDate = new Timestamp(cal.getTimeInMillis());
mutableIssue.getPriorityObject();
mutableIssue.setDueDate(dueDate);
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 46.109.227.104 /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(GroovyScriptEngineImpl.java:117)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.