- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2016 12:37 PM
I have a requirement to set users as on "Litigation Hold".
I have added a Litigation check box to the user form.
I have also configured sweet alerts to pop up when the caller_id is on litigation hold. This way when an incident is opened and the caller that is set is on Litigation hold it pops up a message and another client script to set the message under the caller_id field
This pop up works when the customer is set as a Litigation user.
The users in our company that are on litigation hold is specified in the description field in AD. That description maps to the description in the user form in SN via an ldap transform.
There are about 1300 users in our organization that are on litigation hold, so i need assistance trying to set the checkbox as true via a background script, or a client script or business rule. (whichever way is easier, im not sure) based on the description field containing "Litigation hold"
Does anyone know of the best way to do this via some script ?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2016 12:44 PM
Here is your BG script. You can also write fix scripts for this. Before running this copy the following script in the background scripts and see the number you get on the console. This is the total number of records that contains description as litigation hold. If it is working as expected then go ahead with the second script
script 1:
Var gr= new GlideRecord("sys_user");
gr.addQuery('<field name of description>','CONTAINS',"Litigation hold");
gr.query();
gs.print(gr.getRowCount());
Script 2:
Var gr= new GlideRecord("sys_user");
gr.addQuery('<filed name of description>','CONTAINS',"Litigation hold");
gr.query();
while(gr.next()){
gr.<litigation hold field name>=true;
gr.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2016 12:44 PM
Here is your BG script. You can also write fix scripts for this. Before running this copy the following script in the background scripts and see the number you get on the console. This is the total number of records that contains description as litigation hold. If it is working as expected then go ahead with the second script
script 1:
Var gr= new GlideRecord("sys_user");
gr.addQuery('<field name of description>','CONTAINS',"Litigation hold");
gr.query();
gs.print(gr.getRowCount());
Script 2:
Var gr= new GlideRecord("sys_user");
gr.addQuery('<filed name of description>','CONTAINS',"Litigation hold");
gr.query();
while(gr.next()){
gr.<litigation hold field name>=true;
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2016 08:56 AM
Thank you. It is working exactly how I needed it with your help. The script worked flawlessly, thank you.
Var gr= new GlideRecord("sys_user");
gr.addQuery('u_description','CONTAINS',"Litigation hold");
gr.query();
gs.print(gr.getRowCount());
Var gr= new GlideRecord("sys_user");
gr.addQuery('u_description','CONTAINS',"Litigation hold");
gr.query();
while(gr.next()){
gr.u_litigation=true;
gr.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2016 09:07 AM
Glad I could help