Change Model State automatic transition from Implement to Review is failing

thrsdy1512
Tera Expert

I am trying to create a automatic state transition from Implement to Review when the planned end date on a change request is now or in the past. 

I am doing this using a transition script as this seemed like the obvious option and using this code, but the change stays stuck in Implement after the end date has passed:

 

(function (current) {
 
var now = new GlideDateTime();
var endDate = current.endDate
if (endDate <= now){
    return true;
} else {
return false;
}

})(current);
2 REPLIES 2

GlideFather
Tera Patron

Hi @thrsdy1512,

Please check whether there is not associated change task on that change request.. it may be created automatically and if so, your script would need to manipulate these tasks (closed complete them) it shall allow you to move to the next state

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


all associated change tasks are closed but the change request still stays in Implement when the end date hits.