The CreatorCon Call for Content is officially open! Get started here.

Role needed to call rest API

Its_Azar
Tera Guru
Tera Guru

I have a Record Producer in Service Portal. On change of a field, I call an endpoint that sets values in another field based on the user’s selection. I’ve implemented this using a Catalog Client Script that calls a Script Include to process the REST request.

The issue is: for normal users, the request doesn’t trigger at all, but if I give the user the ITIL role, it works as expected. Giving ITIL seems like overkill.

How can I make this work for normal users without granting ITIL.

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.




Kind Regards,

Mohamed Azarudeen Z

Developer @ KPMG

 Microsoft MVP (AI Services), India
2 ACCEPTED SOLUTIONS

KrishnaMohan
Giga Sage

Hi @Its_Azar 

so it is working for itil role users but not for others. I believe you are using glideajax to call script include from client script and require that users satisfy an ACL associated with your script include.

ACL for  client callable / Glide AJAX enabled script includes determine who can access a Glide AJAX/client callable enabled script include.

what is the acl for your script include?


Regards,
krishna mohan

View solution in original post

 

Hey, @KrishnaMohan 

that was spot on. I didn’t realize my client-callable script includes would automatically create ACLs—silly me. And yeah, for some reason I had ITIL set as a required role. thanks much i was going through everything to check what went wrong never thought of this.

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.




Kind Regards,

Mohamed Azarudeen Z

Developer @ KPMG

 Microsoft MVP (AI Services), India

View solution in original post

5 REPLIES 5

Bhuvan
Mega Patron

@Its_Azar 

 

Why to use REST API call if you are updating fields in ServiceNow ? If operation is within ServiceNow, do not use REST API. Problem might not be with API call for normal users but most probably underlying ACLs for the tables/fields you are trying to update.

 

If you are validating some information from external URL, processing the payload and updating the fields,  create scripted REST API or REST Action in Flow Designer and define the roles who has access to call the API and try it.

 

Check below article for more details,

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0822211

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0813159

 

If this helped to answer your query, please mark it helpful & accept the solution. 

 

Thanks,

Bhuvan