- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 04:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 03:09 AM - edited 10-21-2024 03:10 AM
Hi,
Try to use answer instead of return and change as below
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) {
answer = true;
}
else
{
answer = false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 03:17 AM
Thanks Anurag
tried that no luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 03:18 AM
Can you define what condition you want to check and a sample user record along with expected behavior?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 09:57 PM
user has title 'DCL - Digital Workplace'
but evaluates to false in user criteria diagnostic tool. but in background script it evaluates to true