How to make a change request Active to false

Mounika66
Giga Contributor

I have a change request whose state was closed incomplete. But still active shows true instead of false.

How can I manually make active false?

Thanks in advance.

1 ACCEPTED SOLUTION

background script

 

var gr = new GlideRecord('change_request');

gr.addEncodedQuery('state=4^active=true'); //make sure about closed incomplete state value

gr.query();

while(gr.next()){

gr.active=false;

gr.setWorkflow(false);

gr.update();

}

 

View solution in original post

7 REPLIES 7

Pooja Mallikarj
Kilo Sage

Hi,

Can you try with background script ?please let me if you need any help with this.

Thanks,

Pooja M

If you have single change request and you want to make that as false then you can use below code.

var gr=new GlideRecord('change_request');
gr.addQuery('sys_id','sys id of your change request');
gr.query();
if(gr.next())
{
gr.active='false';
gr.setWorkflow(false);
gr.update();
}

Thanks,

Pooja M

Alok Das
Tera Guru

Hi Mounika,

OOB Close Incomplete choice is not available in the change_request please find the snipped below for reference.

 

Active field is editable for the admin, It seems like your state field is configured and you have some restrictions configured on writing of active field. If there is no restrictions on writing of active field then  reconfirm that you have the admin role to change the field manually.

 

Also, "mark_closed" business rule on 'change_request' table changes the active field to false. Verify that it has the filter condition added closed incomplete to fix this issue permanently.

 

 

Kindly mark my answer as Correct and Helpful based on the Impact.

Regards,

Alok