Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Inactive approvers are showing in change and requests

chinna
Mega Guru

Hi All,

I want to hide the inactive users before it moves to the approval section.

for example if the user is inactive in snow,we want to hide the user in the change request approval section and service request approval section.

 How can i acheive this? if we need  to write a glide query on sys approval table.

can anyone share the script

 

Thanks ,

Chinna

 

6 REPLIES 6

Hi Nitin,

 

Can you pls share the code for this, am new to scripting.

 

Thanks,

Chinna

asifnoor
Kilo Patron

Hi

Here is the script to get active sysapprovers.

var gr = new GlideRecord("sysapproval_approver");

gr.addQuery("sysapproval","your_sys_id");

var grsq = gr.addJoinQuery("sys_user", 'approver' , 'sys_id');

grsq.addCondition('active', 'true');

gr.query();
while(gr.next()) {
  gs.print(gr.getValue("approver"));
}

Kindly mark the answer as correct if this works for you.