Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2024 08:11 AM
I have a topic that I am trying to restrict from users whose location.country is not US or those in a certain business unit. I have tried using the script in the Advanced Properties within the VA topic to no avail. I have tried using the user criteria method found here. I have also tried this solution, and writing my own script. None of it works.
Here's the script I used.
(function execute() {
var user = new GlideRecord('sys_user');
user.addQuery('sys_id', gs.getUserID());
user.query();
if(user.next()){
var country = user.location.country.toString();
var bu = user.cost_center.u_business_unit.toString();
}
if(country == 'US') {
return true;
}
else if(bu == '<bu sys id>'){
return true;
}
else{
return false;
}
})()
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2024 11:21 AM
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2024 11:21 AM
I got it to work with my script by logging off and back on.