How to copy incident field data to requested item field

Ashwini35
Tera Contributor

Hi All,

 

I need to convert Incident to request using workspace ui while incident is getting converted to request it should copy few of the incident field like short description/ description to request, can someone please guide to copy field details? I am using below ui action code for create request ui action which is configured under ITSM Workspace application - 

function onClick() {
g_form.setValue("state","8");
g_form.setValue("close_code","Converted to Service Request");
g_form.setValue("close_notes","Converted to Service Request");
var result = g_form.submit('sysverb_ws_save');
if (!result) {
//failed form submission
return;
}

result.then(function() {
var params ={};
params.sysparm_parent_table = "incident";
params.sysparm_parent_sys_id = g_form.getUniqueValue();
g_service_catalog.openCatalogItem('sc_cat_item', '-1', params);
});
}

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Ashwini35 

 

Greetings!!

 

I am not agree with you, the reason is , it is not a best practice to convert Incident to request 

1. The actual created date will be missing or not correct.

2. You / team already loose some time as part of SLA.

3. If you/ team will do, then it become habit and  over some time it will become overhead.

 

To reduce this

1. Educate to users

2. Create KB and show what goes in Incident or in request.

 

*************************************************************************************************************
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]

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

Hi Atul,

 

Thanks for your reply!

Actually this is not something I am customizing this feature to convert incident to a service request is available for us oob from servicenow. The above code which I shared this is available oob I just need to add an ability to copy incident details to requested Items so that user's manual work will get reduced.

Opps.. my bad  😞 

 

Generally these fields get copied via property level. But how this work , i am not fully sure.

 

Check Properties or UI action script. ( to create new record from parent) 

Incident properties

Problem properties

Change  

 

AtulyaLNG_0-1699532462430.png

 

*************************************************************************************************************
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]

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