Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

How to Change the Change Request state back to the Previous State

SayanG838505890
Tera Contributor

Hello Team,

Recently I have created a New RFC type(Informational) for Change Request.

For That I have created a BR. Which will work only when change task of RFC type is Informational.
But the BR is not correct and impacted the rest of the RFC Type.
Now I have disabled the BR, but now I want to make the Change Request state back to Previous state.
Condition:

SayanG838505890_0-1765967328409.png

 

(function executeRule(current, previous /*null when async*/) {

    var change_request = new GlideRecord('change_request');
    change_request.addQuery('change_request',current.sys_id);
    change_request.query();
    while(change_request.next()){
        change_request.setWorkflow(false);
        change_request.state = 0;
        change_request.update();
    }

})(current, previous);



Now Please help me to change the state of the Impacted Change Request to the Previous State
Thanks in advance
0 REPLIES 0