filter incidents by logged in user region
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2016 09:16 AM
Hi All,
I am trying to filter the incidents by logged in user region, I am trying to use a dynamic filter to achieve this. But i am unable to find the user region in the relates list fields.
Please help me !!
Thanks,
Nani.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2016 10:48 AM
Hi Nani,
I would approach this by creating a script include that does a lookup of the current user's record and return the region, then call your script include from the dynamic filter. Note: All code below is untested and may require adjustments to work on your system.
E.g.
var getMyUserInfo = Class.create();
myConditionCheck.prototype = {
initialize: function() {
},
myRegion : function() {
var user = new GlideRecord('sys_user');
if (user.get(gs.getUserID()) {
return user.u_region;
}
return;
},
type: 'myConditionCheck'
};
Your dynamic condition would then contain
new getMyUserInfo().myRegion();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 10:29 AM
Hi Chuck,
But then how can we link the dynamic filter to the incident module?? Does the dynamic filter show up in the related list in the filter conditions??
Thanks,
Nani

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 10:46 AM
Hi Nani,
I'm going to assume you mean you want to click here:
And want a filtered list to appear based on some field value (e.g. Region (u_region)) in the incident record. Please clarify if my assumption is incorrect.
First, navigate to System Definition> Application Menus
Open the Service Desk record and go to the related list of modules at the bottom of the form.
Locate the Incidents record and open it.
Change the record so Link type is set to URL from arguments and Arguments points to the URL including a call to the script.
This link may help.
http://wiki.servicenow.com/?title=Navigating_by_URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 10:52 AM
I have to create a incident module under incident application which filters the incidents based on the logged in user region. To do this i have created a script include and a dynamic filter, also i have attached script include to the dynamic filter. But then i am not seeing the (is Dynamic) option in the related list in the filter condition in the incident module which i am trying to create.
I think this clarifies your doubr