gs.hasRoleExactly('itil') is returning undefined

Sachin G K1
Kilo Sage

Hi All,

gs.hasRoleExactly('itil'), is returning undefined. But gs.hasRole('itil') is returning true please help.

SachinGK1_0-1709621853034.png

SachinGK1_1-1709621888260.png

 

12 REPLIES 12

dgarad
Giga Sage

Hi @Sachin G K1 

 

Please refer below link.

https://www.servicenow.com/community/itsm-articles/uses-of-hasrole-methods-client-and-server-side/ta...

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

swathisarang98
Giga Sage
Giga Sage

Hi @Sachin G K1 ,

 

Could you please share the screen shot of reference qualifier ? and could you please clarify what you are trying to achieve?

 

Please check and Mark Helpful and Correct if it really helps you.

Regards,

Swathi Sarang

 

 

Its not related to field, i have called the script include in 'cancel' ui action on change request table to achieve some requirement. Meanwhile i used, gs.hasRoleExactly but is not returning true/false. However gs.hasRole working fine

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @Sachin G K1 ,

 

You cant ! you only have client side api for hasroleExactly(); you cant use it on client side...

 

on server side you can only use gs.hasRole(); to check for roles , i hope this helps...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Sorry i didn't get, i had recently used gs.hasRoleExactly() in acl script it was working fine