How to trigger event from business rule to remove deactivated users

BanuMahalakshmi
Tera Contributor

Hi,

I have requirement to create business rule - remove deactivated users from  assigned_to field(list type) from the table cmdb_Ci.

I want to trigger event passing CI(configuration item name) and deactivated user value and the event should remove disabled user from the field assigned_to.  please advise me the script. 

Thanks.

3 REPLIES 3

Max Nowak
Kilo Sage

Assuming the trigger is when a user in the sys_user table is set to inactive?

Create a Business Rule on the sys_user table which triggers on AFTER, where the "Active" field changes to "False":

 

MaxNowak_0-1737113678458.png

 

Configure the "Script" field in the Advanced tab with a simple query:

MaxNowak_2-1737114390654.png

 

 

 

 

Thanks for reply, My Assigned_to field type is list..it contains many users.  my client asked to - trigger event passing CI name, disabled user name. this event should remove deactivated user from assigned_to field

Ankur Bawiskar
Tera Patron
Tera Patron

@BanuMahalakshmi 

please avoid creating duplicate questions.

script to trigger Event to remove disable user 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader