
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 02:06 PM
I need to create a new module/list of records that only displays items from the current logged in users department?
Does anyone know how to accomplish this ask?
Example: I logged into ServiceNow Self Service and click the "My Department Open" button. From there a list of records should appear showing only items related to my department.
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 02:44 PM
Create a new module and in the Link type select the list of records, table and then in the conditions put
business_unit is javascript:gs.getUser().getDepartmentID();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 02:39 PM
I created a custom application and within the app there is a field called "Business Unit" which is populated by an on onLoad client script. The script populates the field with the department of he current user logged in (script below). What I'm trying to do now is create a module that shows all items/incidents where the "Business Unit"/ Department is equal to mines. Hope that makes sense
function onLoad() {
//Type appropriate comment here, and begin script below
var user= g_form.getReference("requested_for", callBack);
function callBack(user){
g_form.setValue("business_unit",user.department);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 02:41 PM
Great observation Abhinay! I made several assumptions when I gave my advice, and I should have asked the same question to clarify.
In fact, in addition to the clarification of "ticket" I'll ask 2 more questions of Edwin:
1. When you say "My Department Open", do you mean that you want all tickets assigned to your department? Or do you want all tickets opened or requested by members of your department?
2. What do you mean my "department"? and is the membership of this department defined in the Groups table?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 02:44 PM
Create a new module and in the Link type select the list of records, table and then in the conditions put
business_unit is javascript:gs.getUser().getDepartmentID();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 02:49 PM
I tried this route before and it didn't work, but it's working now!! Thanks so much

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 02:54 PM
Glad you got it working.