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.
Scheduled Jobs creating multiple Request Items on same Request - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Scheduled Jobs creating multiple Request Items on same Request
KB0725236

Scheduled Jobs creating multiple Request Items on same Request


2072 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

Overview


Scheduled Jobs creating multiple Request Items on same Request

Issue


When there are multiple scheduled jobs configured at the same time to generate requests using Service Catalog Script API, Run As is same user for all Scheduled Jobs for the same item, multiple Request Items on same Request might get created. Some Requests doesn't have Request Items.

 

Sample Script in Scheduled Jobs, where these are trying to order same Catalog Item:

var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
var item = cart.addItem('e46305bdc0a8010a00645e608031eb0f'); 
cart.setVariable(item,'os','Linux Red Hat');
var rc = cart.placeOrder(); 
gs.addInfoMessage(rc.number);

Run as: System Administrator

Time to Run: 12 AM

Reason


 Since all Scheduled Jobs are ordering same Catalog Item with the same User at the same Time, records in "sc_cart" table might get duplicated or messed up while submitting.

Additional Information


1) Run the scheduled Jobs at different Times.

2) Merge All scheduled Jobs to a single Scheduled Job and place the code in a While Loop to make sure Item Submission follows an order.


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.