
- 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:27 AM
Hello CB,
Thank you so so much. it worked.
I have a question, why it is not sth like this?
javascript:if(!gs.hasRole('itil')^'stateNOT IN3,4^EQ^' + ScrumSecurityManager.getStoryDotEpic(current) or javascript:if(!gs.hasRole('itil') + 'stateNOT IN3,4^EQ^' + ScrumSecurityManager.getStoryDotEpic(current)
no need to use + or ^ as AND to connect if(!gs.hasRole('itil')) and 'stateNOT IN3,4^EQ^'?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2020 08:53 AM
Hi Oliver,
Ya you don't have to use + side or ^ sign to put the condition as you want if the user doesn't have role then you need this reference qualifier so it will come directly : as this is will only satisfy when the role condition.
if(!gs.hasRole('itil') 'stateNOT IN3,4^EQ^' + ScrumSecurityManager.getStoryDotEpic(current)
It means first part is satisfied then the reference qualifer will get applied its not addition to both the condition.
Please mark helpful.
Thanks,
CB