Advanced Reference Qualifier only works for certain role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2015 11:12 AM
I have installed the Loaner Management application by Chuck Tomasi. This was made in an old version of ServiceNow and I have made it work in Fuji with some customization.
I am running into a major issue with the Advanced Reference Qualifier in the Record Producer on the field cmdb_ci.
The reference qualifier is designed to return only the particular loaner items that are available between the selected start and end date. Thus, if the loaner is already reserved for any date in between the selected date, it doesn't show up in the list.
This works great -- ONLY for users with the role "loaner_admin". I noticed that any user that doesnt have that role, the reference qualifier isn't working! The reference field returns ALL of the items, even if they are already booked for the time period.
I tried logging in as a loaner_admin user and it works, but when I log in as a user with any other role, ALL of the items are available in the list and this results in a DOBULE booking. Yikes!
I then granted my test user the loaner_admin role and it worked. So, I know it has to do with an ACL on that role.
I experimented with the ACL rules, I added the role "user" to the "write" action on the cmdb_ci field but that did not solve the issue.
Reference Qualifier on cmdb_ci
javascript: new LoanerUtilsClient(current).availableCis(current.variables.item_type, current.variables.depot, current.variables.start_date, current.variables.end_date);
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2015 01:31 PM
The last gs.log in the the script, gs.log(availableItems);
Does it have the same values for ess and loan_admin?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2015 01:39 PM
The values are different, the loaner_admin correctly shows the item that isn't available for the selected dates, whereas the ESS shows all available items.
ESS
03eee2b7c1f7210077ae9f5f3e49e9bb,
07eee2b7c1f7210077ae9f5f3e49e9bb,
0feee2b7c1f7210077ae9f5f3e49e9ba,
43eee2b7c1f7210077ae9f5f3e49e9bb,
47eee2b7c1f7210077ae9f5f3e49e9bb,
7aeee2b7c1f7210077ae9f5f3e49e9b9,
83eee2b7c1f7210077ae9f5f3e49e9bb,
8beee2b7c1f7210077ae9f5f3e49e9ba,
c3eee2b7c1f7210077ae9f5f3e49e9bb,
cbeee2b7c1f7210077ae9f5f3e49e9ba
loaner_admin
03eee2b7c1f7210077ae9f5f3e49e9bb,
07eee2b7c1f7210077ae9f5f3e49e9bb,
0feee2b7c1f7210077ae9f5f3e49e9ba,
47eee2b7c1f7210077ae9f5f3e49e9bb,
7aeee2b7c1f7210077ae9f5f3e49e9b9,
8beee2b7c1f7210077ae9f5f3e49e9ba,
c3eee2b7c1f7210077ae9f5f3e49e9bb,
cbeee2b7c1f7210077ae9f5f3e49e9ba
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2015 01:47 PM
Ok,
So the issue is inside the code itself.
I am assuming the extra values that ess is seeing is ones where the install status is false, and they should be filtered out.
Out of curiosity, can you change the line we added to the other property?
gs.log('Properties: ' + checkAvailProperty ');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2015 01:54 PM
Hi Robert, All of the items have Install Status true.
The extra values that ESS is seeing are the ones that are already reserved for the selected dates.
A Loaner Request is submitted for Loaner Mac 01 between August 14 and August 18.
When logged in as loaner_admin, when I select August 14 to August 18 (or any overlapping dates) and open up the cmdb_ci to select an item (triggering the reference qualifier), the Loaner Mac 01 does not appear. This is correct, since I can't double book any items.
However, when logged in as ESS, when I select August 18 to August 18 and open up the cmdb_ci, the Loaner Mac 01 DOES appear in the list.
I realized this issue because ESS users are starting to double-book loaner items, which is bad for our process. Thanks again for looking into this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2015 01:58 PM
Oh and for both ESS and loaner_admin Properties: 1,6