Reference Qualifier roles=itil not working

Oliver13
Mega Guru

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.

find_real_file.png

1 ACCEPTED SOLUTION

Chander Bhusha1
Tera Guru

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

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hello Ankur,

Sorry, it doesn't work. 

Chander Bhusha1
Tera Guru

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

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