Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to create a catalog item from scheduled job

shaikimran4
Tera Contributor

I have a requirement to create a catalog item bi-weekly automatically without manual intervention. I am trying this logic in scheduled Job, but it is working. but when I try in Background scripts it is working as expected.

 

var cart = new sn_sc.CartJS();
var newItem = cart.addToCart({
    "sysparm_id": "04b7e94b4f7b4200086eeed18110c7fd",
    "sysparm_requested_for": "62826bf03710200044e0bfc8bcbe5df1",
    "variables":{
        "acrobat": "true",
        "photoshop": "false",
        "Additional_software_requirements": "testing the software"
    }
});
var checkoutInfo = cart.checkoutCart();
 
 
Can someone help me out on this.
6 REPLIES 6

Check this:

 

https://www.servicenow.com/community/developer-forum/creating-a-request-requested-item-from-flow-des...

 

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@shaikimran4 

as per your question you said it's working from both scheduled job and background script

so what's your question?

AnkurBawiskar_0-1763041917828.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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