Write a Code for user is itil or not in workflow for if condition ??

1dusjhyahnt
Tera Contributor

Hello User

 

I need a urgent help of How to recognise the user having a ITIL Role or not.

7 REPLIES 7

Chetan Mahajan
Kilo Sage

Hello @1dusjhyahnt ,

                           in workflow script you can use  gs.hasRole("itil") to know if the logged in user has "itil" role.

Kindly mark correct and helpful if applicable

Kishor O
Tera Sage

Try with 

If (gs.hasRole("itil"))

Please refer below community post.

https://www.servicenow.com/community/itsm-forum/how-to-check-the-persons-who-are-having-itil-role/td...

 

Thanks,

Kishor

Jaspal Singh
Mega Patron
Mega Patron

Hi,

Considering you are using GlideRecord User table to check you can simply use below condition

roles=itil as an addEncodedQuery()

If not, please help detail what activity it is being used to add some more context.

Sandeep Rajput
Tera Patron
Tera Patron

@1dusjhyahnt In your script check the following.

 

if(gs.hasRole('itil')){
//Do something
}
else{
//Do something else
}