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

Iakshmi,



How do you add variables to the request item? I do not see that option on 'create task'; only on 'catalog task'.



Thank you,


Lida


Hi Lida



You need to use my approach - see the first reply. You do it from a script activity.



Just creating a request with a task activity will not give you anything usefull


Hi Lars,



That is what I ended up doing, using the script activity rather than create task. Thanks.



Lida