How to autocreate RITM once date is expired
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 12:10 AM
Hi Team,
How to auto create RITM once date is expired.
Ex:
Date is expired, then automatically needs to create Requested Item.
How to create automatically Requested Item
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 01:06 AM
Hi @Gopal14,
Please follow the standard process as per the Servicenow like REQ>>RITM>>TASK in this manner. To create the this aurmatically, please write this code in schedule job and valide when your date is going to expire:
try{
var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
//add your requested item to the cart by sys_id of the catalog item
var item = cart.addItem('0336c34407d0d010540bf2508c1ed096', 1);
//fill in the variables on the request item form
cart.setVariable(item, "asset", "00a96c0d3790200044e0bfc8bcbe5dc3");
cart.setVariable(item, "multiple_choice", "Phoenix");
var rc = cart.placeOrder();
gs.info(rc.number);
}
catch(ex){
gs.info(ex);
}
Please pick the variable name where they are mandatory.
Please accept my solution if it works for you and thumps up.
Thanks
Jitendra
Please accept my solution if it works for and thumps up.