converting request from incident using ui action

abhisek
Tera Contributor

We have a catalog item for example 'request anything'. Manually to create a request for this catalog item after mentioning all the mandatory field details we need to click on 'proceed to checkout' and the need to click on 'checkout' to submit a request.

Using UI Action on incident form, we want to create a request for that catalog item 'request anything'. The UI Action is in Service Operation Application scope and the catalog item is in global scope.

By using the below script, I am trying to submit a request, but this script is not submitting the request.

 

 

(function executeRule(current, previous /*null when async*/ ) {

gs.addInfoMessage('SOW Inside');

var cart = new sn_sc.CartJS();
var item = {
"sysparm_id": "sys id of the catalog item",
"sysparm_quantity": "1",
"variables": {
"request_summary": "short_description",
}
};
// var cartDetails = cart.addToCart(item);
var request = cart.checkoutCart();

// gs.addInfoMessage('SOW request_id ' + request.request_id);
gs.addInfoMessage('SOW request ' + JSON.stringify(request));

 

})(current, previous);

 

Can anyone please help me out, it is so urgent.

8 REPLIES 8

Hi @abhisek

That's Great. 

Thank you, please make helpful if you accept the solution.

Hi @Yashsvi 

Still one thing is not working.

I have to populate 3 variable values of the RITM as well as per the incident description, short description and urgency.

Dr Atul G- LNG
Tera Patron
Tera Patron

You can use OOTB, create request  UI action for this. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

BillMartin
Mega Sage
Mega Sage

Hi @abhisek  ,

 

As a ServiceNow Certified Instructor, we do not recommend customizations. As platform best practice, we continuously guide implementors and developers alike to stick to what is out of the box capability of ServiceNow.

 

The guidance we have provided from another thread has already addressed your concern and to step back further, the usage of the technology requires evangelism and adoption to the end user.

 

In addition, customization will accumulate technical debt further misleading implementers and developers alike.

 

Reposting our response for your guidance. 

 

Here is How: One Common Mistake: How to Convert an Incident to a Request (Using ITSM Service Operations Workspace...