How to get users having only ITIL role but not admin role

ajay konduru
Tera Contributor

How do I get users who have only ITIL role but not any other role like admin role?

10 REPLIES 10

Kunal Varkhede
Tera Guru

Hi,

 

Use this in your script

gs.hasRoleExactly('itil');//Returns true only if the current user has the specified role.

 

Thanks,

Kunal

I need to query all the user records through glide record And iterate with this statement right? Is there any better approach

Azim Kazi
Giga Guru

Hi Ajay,

I have figure out the way

we can use filter: sys_id - is - "javascript:getRoledUsers('IN','itil')"

 

 

as I shown below:

 

find_real_file.png

 

 

Hope this will help you!!

If my response helps you then kindly mark my answer helpful 👍and correct ✔otherwise if any query 🤔 feel free to ask further.

 

Thanks,

Ajim

Allen Andreas
Administrator
Administrator

Hi,

If you could explain a bit more, that'd be great...

Not sure what you mean by "how do I get" and then what are you doing with them?

Otherwise, like what's happening here, we provide responses and then you have to ask follow-on questions.

Let us know what you'd like to do like:

I would like to find all users within my instance that have ITIL role, because I want to add them all to 'x' group...

Then we can help more specifically and efficiently.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!