Business rule to create request item in a Catalog item

dileep0146
Tera Contributor

Hi All,

I have to create a Business rule on sys_user for any new records created by "ta_admin" then create that new user request with the variable incident management role as ‘normal user’ in  the Tenforce catalog item.

Thank you.

6 REPLIES 6

Amit Verma
Kilo Patron

Hi @dileep0146 

 

Can you please explain your requirement in detail ? As far as I was able to understand, you want to Submit a Catalog Item from a Business Rule and the catalog item contains a variable Incident Management Role for which you want the value to be set as Normal User.

 

Thanks and Regards

Amit Verma

Thanks and Regards
Amit Verma

Hi Amit,

Thanks for your reply.

I have to create a After Insert business rule and the requirement is if any user record is created by "ta_admin" then I have to create a new request in the newly created Catalog item.

 

Please let me know if you need more information.

@dileep0146 

 

You can use the Cart API inside the Business Rule to submit the catalog item. Refer below post and give this a try :

https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-business-rule/m-p/181...

 

Thanks and Regards
Amit Verma

        use cartAPI in BR

 

        var cartId = GlideGuid.generate(null);
        var cart = new Cart(cartId);
        var catalogItem = 'YOUR CATLOG ITEM SYS_ID';
        var item = cart.addItem(catalogItem);

        cart.setVariable(item, 'ADD YOUR VARIABLE', 'PASS Value from user table');
        var req = cart.placeOrder();