I have a requirement, to check the assignment group=='servicenow admin'

DINESH CHINNAD1
Giga Expert


then i have check the below condition in the BR

 

 

gs.getUser().isMemberOf('itil') && current.assignment_group==''servicenow admin"

 

here how i can check whether the user is member of 'itil' by using the tables like incident or change request or service request... which field of table like incident or change request or service request is having the member name of 'itil'

 

is that caller (or) assigned to????

 

Thanks in advance...

1 ACCEPTED SOLUTION

DINESH CHINNAD1
Giga Expert

Hi All,



I think i confused all... Atlast i found the answer....



Its very simple thing, just i have "impersonate the user" to check whether he/she is member of the group..



Anyway thank you all for supporting me....


View solution in original post

4 REPLIES 4

jsi
Mega Guru

Hi,


        Try with gs.hasRole('itil') && current.assignment_group.name==''servicenow admin".


Thanks


Ashok10
Mega Expert

What J S has mentioned is correct. Just want to give some more info.


ITIL is not a group basically its a role.


To check whether current logged in user have ITIL role you need to use


gs.hasRole('itil');



Also to check whether current user is member of particular group you need to use


gs.getUser().isMemberOf(<your group name>)



hope this helps


Hi Sai Kumar,



In the below Script,


gs.getUser().isMemberOf('itil')



Ya you are correct by   mistake i put role name "itil".   My group name is "service desk"... But my doubt is how can i check which field in the incident table whether the user is belonged to that "service desk" group.


DINESH CHINNAD1
Giga Expert

Hi All,



I think i confused all... Atlast i found the answer....



Its very simple thing, just i have "impersonate the user" to check whether he/she is member of the group..



Anyway thank you all for supporting me....