How do I end resource assignments for a user no longer at the company

Linda_G
Kilo Sage

Right now we have a very manual process for setting up resource in SPM. But one of the other issues i'm trying to tackle is ending resource assignments for a user who is no longer at the company.

 

I know if they have the pps_resource role and a start and end date that I can remove the assignments from the system, however we have to update our Workday Integration to populate this data.  The other piece we need to look at is we've automated the removal of groups from a user when they are inactivated in the system.  So them having the pps_resource role for the job to work, isn't an option.

 

I'd love to hear how you are all cleaning these up and removing capacity for these users.  

2 REPLIES 2

Rafael Batistot
Tera Sage

Hi @Linda_G

The best approach is to create a scheduled job that runs daily, checking the sys_user table for users with "the pps_resource role and both a start and end date". 

When found, remove. 

This a simple sintaxe to update this user when found 

var grQuick = new GlideRecord('incident');
grQuick.addQuery('active',true);
grQuick.query();
while (grQuick.next()) {
  grQuick.active = false;
  grQuick.update();
}

 
or delete 

grQuick.deleteRecord();



Arnab19
ServiceNow Employee
ServiceNow Employee

Hi @Linda_G ,
You can set the end date in the employee profile of the resource and the capacity will not be generated.