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

How to cross scope "Scripted REST Service"

chanikya
Kilo Sage

Hi All,

I request you please help me on below concern

We have Scripted REST Service(GET)- sending Incident data when request comes, Some times Successfully Data passing , some times going to else part & sending  error "No data found" to other party.

When I checked Transaction logs, "Origin Application" showing different scopes for same 'Scripted REST Service",
some times "Customer Service",
Some times "Global,",
Some times "Human Resource",
some time "Guided Tour"
is this Problem ? why for same Scripted REST Service" different scopes showing in "Origin Application" columns. ? sometimes successful, some times Error Message ?


chanikya_0-1755747228325.png

 

If this is because of lacking of crossscoping ? 

10 REPLIES 10

@chanikya 

So scripted REST API is in Global scope.

Next question

-> how is this getting called?

-> is it called from within the instance but from different scope such as HR, GRC etc?

-> if yes then definitely cross scope might come into picture as you are calling it may be from BR which is in HR or GRC scope but scripted REST API is in Global scope

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

We shared
scripted REST API Resource Path ( Application : Global)
Service Account ( API User)  details to other tool peoples , they utilized ServiceNow details thier side.

No Flow, No BR, No Script Include. we scripted in Scripted REST Resource(sys_ws_operation)

Bhuvan
Mega Patron

@chanikya 

 

Can you share the Scripted REST API and which scope it is created under ?

 

Are you sure someone not just testing it manually from REST API explorer and their scope is different to Scripted REST API definition without cross scope privileges that is causing the issue ? 

 

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

 

Thanks,

Bhuvan

Scripted REST API in Global Scope.

Yes, we are sure no one testing manually , they are requesting INC data from different tool.

we don't have any script include and flows, it's simple GlideRecord record in Scripted REST API.
they will search with User ID, user related incidents details scripted rest api will returns that it. 

but not understanidg why different scopes showing under "Origin Application" column.

kaushal_snow
Mega Sage

Hi @chanikya ,

 

The Scripted REST service persists in its original scope (e.g., Global or a custom scoped app). However, the calling context, for instance, a REST Test, Script Include, or Flow can originate from different scopes. This does not mean the service itself is moving across scopes; rather, it's being invoked from clients in various application contexts.

 

Note: Check that the Scripted REST API is consistently defined in the correct and intended application scope......

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/