- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 04:06 AM
Script I am using is creating two tasks and the date is not filling out the data from the sctask level please help!
Script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 07:18 AM
Fixed the issue with the following code:
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('136cdab01b50311070fb4002dd4bcb24', 1);
//fill in the variables on the request item form
cart.setVariable(item, 'what_can_we_help_you_with', "Fix lights on floor 1");
cart.setVariable(item, 'can_you_give_us_some_more_details', "this is more information");
cart.setVariable(item, 'are_you_a_member_of_the_facilities_team', "Yes");
cart.setVariable(item, 'actual_work_start', "2023-07-25 15:08:09");
cart.setVariable(item, 'actual_work_end', "2023-07-26 15:08:11");
var rc = cart.placeOrder();
gs.info(rc.number);
}
catch(ex){
gs.info(ex);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 05:56 AM
I found by using this code
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('136cdab01b50311070fb4002dd4bcb24', 1);
//fill in the variables on the request item form
cart.setVariable(item, "short_description", "136cdab01b50311070fb4002dd4bcb24"); // asset here is variable name and since it's reference we have used sysId
var rc = cart.placeOrder();
gs.info(rc.number);
}
catch(ex){
gs.info(ex);
}
it will follow the workflow but and this is all I need but having trouble with filling out the data how to fill out the short description:
This line of code does not work
cart.setVariable(item, "short_description", "136cdab01b50311070fb4002dd4bcb24"); // asset here is variable name and since it's reference we have used sysId
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 07:18 AM
Fixed the issue with the following code:
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('136cdab01b50311070fb4002dd4bcb24', 1);
//fill in the variables on the request item form
cart.setVariable(item, 'what_can_we_help_you_with', "Fix lights on floor 1");
cart.setVariable(item, 'can_you_give_us_some_more_details', "this is more information");
cart.setVariable(item, 'are_you_a_member_of_the_facilities_team', "Yes");
cart.setVariable(item, 'actual_work_start', "2023-07-25 15:08:09");
cart.setVariable(item, 'actual_work_end', "2023-07-26 15:08:11");
var rc = cart.placeOrder();
gs.info(rc.number);
}
catch(ex){
gs.info(ex);
}