Enhance Testing of Service Catalog Items - Tool for filling out the form?

Guenny
Tera Contributor

Dear All,

is there any easy tool or help available to re-generate / re-fill Service Request Item Form quickly to submit / start the workflow again?

 

I appears very time consuming to me, to fill out all fields manually every-time etc. 

 

Rgds

Guenny

4 REPLIES 4

Sumanth16
Kilo Patron

Hi @Guenny ,

 

create following script in fix script:

 

 

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('4054428fdb151f0097679ec6db9619c0', 1);//change sysid

//fill in the variables on the request item form
cart.setVariable(item,"u_requested_for", "e80edd6edbec6bc097275e25ca9619a4"); 
cart.setVariable(item,"contact_number", "0");
cart.setVariable(item,"assignment_group", "87ec1c342b2e71406c487fb5a8da1524"); 
cart.setVariable(item,"application_service", "cdedfbcedb0f9744c291c170ba9619a7");
cart.setVariable(item,"short_description", 'test');
cart.setVariable(item,"description", 'test');
var rc = cart.placeOrder();

 

  Execute fix script when it is required.

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

James Chun
Kilo Patron

Hi @Guenny,

 

There is an amazing browser plugin called SN Util (available in Chrome and maybe some other browsers too).

It provides a lot of functionalities and one of them is auto-populating the form/catalog item with random values.

Since it populates with random values, it may not fit your purpose but give it a go.

 

Cheers

Hi, thanks for letting me know. I have installed the Util but i don'T find the AutoFill function

No worries, here is a link to the 'cheat sheet' - https://www.arnoudkooi.com/wp-content/uploads/2022/05/SN-Utils-Cheat-Sheet.pdf

 

For your use case, open the form/catalog item and press 'Ctrl' + '/'. Then you will see some pop up on the top left corner. Type rnd and enter. FYI, just realised it only populates the mandatory field.

JamesChun_0-1710441639063.png

 

Cheers