Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Error calling Scoped Outbound REST message - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Error calling Scoped Outbound REST message
KB0720035

Error calling Scoped Outbound REST message


7314 Views Last updated : Jul 24, 2025 public Copy Permalink English (Original)
  • English (Original)
  • Japanese
KB Summary by Now Assist

Issue

Problem


If you need to access on Outbound REST message in another Scope. Assuming it is accessible, you may sometimes get the error:

REST Msg Outbound - RESTMessageClient : Error constructing REST Message/Method: xxxxxxxxxxx [HR Task] HTTP Method (POST): com.glide.generators.InvalidGlideRecordException: Unable to find REST Message Record with Name: xxxxxxxxxxx: com.glide.rest.outbound.RESTMessageDAO.getRestMessageRecord(RESTMessageDAO.java:86)
com.glide.rest.outbound.RESTMessageDAO.<init>(RESTMessageDAO.java:71)
com.glide.rest.outbound.RESTMessageDAO.newInstance(RESTMessageDAO.java:67)
com.glide.rest.outbound.RESTMessageConfig.initNew(RESTMessageConfig.java:67)
com.glide.rest.outbound.RESTMessageClient.<init>(RESTMessageClient.java:57)

[...]

java.lang.Thread.run(Thread.java:748)

Evaluator: com.glide.communications.ProcessingException: Error constructing REST Message/Method:xxxxxxxxxxxr [HR Task] HTTP Method (POST)
Caused by error in script at line 15

13: gs.print(gr.function_name);
14: gs.print(gr.rest_message.name);
==> 15: var sm = new sn_ws.RESTMessageV2(gr.rest_message.name, gr.function_name);
16: 

Solution


 

The Outbound REST message you are trying to call from within your Business Rule or Script Include is in another scope. But it is still accessible. You need to Prefix the REST message name with the scope name. This is referring to the first argument of the function below :

RESTMessageV2(String name, String methodName)

So if you know the name of the Outbound REST you can just add the prefix e.g.:

 

SCOPE = 'my_scope'

REST Message= 'my_rest'

The function call would look like :

var msg = new sn_ws.RESTMessageV2('my_scope.my_rest', 'function_name');

This solution applies even if the REST name is a variable e.g. :

 

SCOPE = 'my_scope'

REST Message= gr.rest_name

var msg = new sn_ws.RESTMessageV2('my_scope.'+gr.rest_name, 'function_name');

 

Root Cause


To call any Scoped resources you need to explicitly specify the scope if you are not in that scope.


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.