How to know user having only snc_internal role or many by using script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 02:26 AM
Hello Experts,
I want to send an email notification based on user last login time.
To all users I can use below script
var gr = new GlideRecord("sys_user");
gr.addEncodedQuery('last_loginRELATIVEGT@dayofweek@ago@77^last_loginRELATIVELT@dayofweek@ago@75^active=true');
gr.query();
while (gr.next()) {
gs.eventQueue('User_inactive_76_days_reminder', gr, gr.email, gr.user_name);
}
Now My requirement is
I want to skip users who is having only snc_internal role
example
ABC user is having ITIL and snc_internal (I want to send notification)
XYZ user is having snc_internal (I want to skip to send notification)
How can i add this condition in existing schedule job...?
Thanks in advance
Best regards
Nani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 03:02 AM
Hi @Nani18
Refer below post, just replace sys_id of itil role with snc_internal.
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Mayur Shardul