- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2023 11:40 PM
I created a transform map to create bulk incidents.
But the user that gets in the incident was the locked out/inactive users.
How can I get the active users?
I have this transform map onBefore script
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2023 12:44 AM - edited 12-18-2023 12:45 AM
Hi @Vengeful , Open the field mapping and enable the 'Use source script' check box and try with below script.
Regards,
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2023 12:25 AM
Hi @Vengeful
Let's check the Use source script checkbox. Below is the sample script to get the Active User.
var grUser = new GlideRecord('sys_user');
grUser.addActiveQuery();
grUser.addQuery('email', source.getValue('u_user')); //replace email by the field corresponding with the value in source. (user_name, name, employee_number, etc);
grUser.query();
if(grUser.next()){
return grUser.getUniqueValue();
}
return '';
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2023 12:44 AM - edited 12-18-2023 12:45 AM
Hi @Vengeful , Open the field mapping and enable the 'Use source script' check box and try with below script.
Regards,
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2023 01:13 AM
It worked, thank you