create a new request from a workflow

Brian Lancaster
Tera Sage

Is there a way to create a separate request from another workflow?

1 ACCEPTED SOLUTION

larstange
Mega Sage

Hi



Yes use the cart API - Service catalog script API



var cart = new Cart(null, gs.getUserID()); //Create the cart as the current user


var item = cart.addItem("sys_id of catalog item");


cart.setVariable(item, 'var name', 'value');


cart.setVariable(item, 'var name 2','other value');


var rc = cart.placeOrder();


View solution in original post

7 REPLIES 7

larstange
Mega Sage

Hi



Yes use the cart API - Service catalog script API



var cart = new Cart(null, gs.getUserID()); //Create the cart as the current user


var item = cart.addItem("sys_id of catalog item");


cart.setVariable(item, 'var name', 'value');


cart.setVariable(item, 'var name 2','other value');


var rc = cart.placeOrder();


Hey,

Do we need to use cart.setVariable(item, 'var name', 'value'); for each variable of that catalog item? 

What to do for the variable sets?

 

 

lakshmidurga
Tera Expert

Hi



I workflow activity we can use Create Task activity and select Task type as Requested Item.



Regards


Lakshmi


lakshmidurga
Tera Expert

Hi



In workflow ,we can use Create Task activity and select Task type as Requested Item.



Regards


Lakshmi