
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2020 07:51 AM
Hello,
Please help me.
I am setting up this Reference Qualifier on table Story for field Epic. Epic is a reference field referencing table Epic.
I set up this first: javascript:'stateNOT IN3,4^EQ^' + ScrumSecurityManager.getStoryDotEpic(current) and it worked.
Then I set up this javascript:'stateNOT IN3,4^EQ^roles=itil^' + ScrumSecurityManager.getStoryDotEpic(current), it doesn't work as I wanted. I want to restrict it to users with role 'itil'. The second 'Reference qual' works exactly the same as the first one.
May I ask how can I add roles to the first 'Reference qual' to make it work?
Thank you so much.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2020 08:03 AM
Hi Oliver,
The roles is not a field on the epic table so you can make use of gs.hasRole('itil') as below: Here the reference qualifier only apply if the user is not having having itil role
javascript:if(!gs.hasRole('itil') 'stateNOT IN3,4^EQ^' + ScrumSecurityManager.getStoryDotEpic(current) ;
If you are having any else condition also then you can use this :
javascript:if (!gs.hasRole('itil')) 'stateNOT IN3,4^EQ^' + ScrumSecurityManager.getStoryDotEpic(current) ; else ------your else condition------;
Please mark answer correct or helpful if it works.
Thanks,
CB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2020 08:02 AM
Hi,
please update as below
javascript:'stateNOT IN3,4^roles=itil^EQ' + ScrumSecurityManager.getStoryDotEpic(current)
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2020 08:22 AM
Hello Ankur,
Sorry, it doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2020 08:03 AM
Hi Oliver,
The roles is not a field on the epic table so you can make use of gs.hasRole('itil') as below: Here the reference qualifier only apply if the user is not having having itil role
javascript:if(!gs.hasRole('itil') 'stateNOT IN3,4^EQ^' + ScrumSecurityManager.getStoryDotEpic(current) ;
If you are having any else condition also then you can use this :
javascript:if (!gs.hasRole('itil')) 'stateNOT IN3,4^EQ^' + ScrumSecurityManager.getStoryDotEpic(current) ; else ------your else condition------;
Please mark answer correct or helpful if it works.
Thanks,
CB

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2020 08:22 AM
Hello CB,
javascript:if(!gs.hasRole('itil') 'stateNOT IN3,4^EQ^' + ScrumSecurityManager.getStoryDotEpic(current) ; doesn't work, even the filter for state is not working (all records are shown).
Thanks