change task changes to Open

KeithM1
Tera Expert

When a change request state moves to Assess, any change task that is not in the open state, moves to the open state.  For example, if I have 2 change tasks and one state is WIP and the other is On Hold, when the Change Request moves to the Assess state, the change task state changes to Open.  I've tried using just a simple business rule that is something like this:

When:  After Update

Condition:  Change Request.State Changes To Assess

Table:  Change Task

Script:  

current.state = previous.state;
        update();

 

Any thoughts on what I can do to prevent it from changing or change the task state back to the previous state?

1 REPLY 1

Harish KM
Kilo Patron
Kilo Patron

Hi you BR should be on change request after updated checked  true 

condition : state changesTo Assess

script:

 var changeTask = new GlideRecord('change_task');
    changeTask.addQuery('change_request',current.sys_id);//change_request holds parent sysid in change task
    changeTask.query();
    while(changeTask.next())
        {
            changeTask.state = 1; //open state value
            changeTask.update();
        }

Regards
Harish