Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 02:56 AM
Hi there
user criteria evaluates correctly in background script but not using user criteria diagnostic tool
function checkCondition(user_id) {
var user = new GlideRecord('sys_user');
user.get(user_id);
if (user.title.indexOf('DCL') !== -1 || user.title.indexOf('CHAPTER LEAD') !== -1) {
return true;
}
return false;
}
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 04:49 AM
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 02:13 AM
Try this
function checkCondition(user_id) {
var user = GlideUser.getUserByID(user_id);
if (user.title.toString().indexOf('DCL') > -1 && user.title.toString().indexOf('CHAPTER LEAD') > -1) {
answer = true;
}else
{
answer = false;
}
}
-Anurag
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 02:18 AM
Hi Anurag
should it be || or &&
Thanks
Levino
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 03:01 AM
Actually it should be || i think.
-Anurag
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 04:49 AM