Convert Incident to SCtask
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2024 02:23 PM
Hi Everyone,
I am trying to be able to create a Request/sctask from the Incident form to allow technicians to convert the incidents to the proper ticket when a users submits incorrectly. I followed the steps below but all that is happening is a request is created but the fields are not getting converted and there are no worknotes added to the new request referencing the original incident.
Below is a summary of what I've done:
UI Action
Client script
details attached
full details in Kb https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0694006
thanks in advance for any feedback you can provide!
Gemma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2024 02:57 PM
Hi @Gemma4 ,
You can add following line client script for work notes transfer.
g_form.setValue("work_notes", grINT.work_notes);
-Thanks,
AshishKMishra
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2024 07:04 PM
Thank you @AshishKM . I added above but unfortunately the request simply gets created and none of the information from the incident is copied to the request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2024 11:41 AM
I think I got things finally working. Thanks all. However, I'm receiving the following error and was curious if anyone else has
var url = 'https://dev173960.service-now.com/now/nav/ui/classic/params/target/sc_request.do%3Fsys_id%3D-1';
url = 'sc_request.do?sysparm_incident_id=' + current.sys_id;
action.setRedirectURL(url);
//action.setRedirectURL(current);
var incidentRequest = (new IncidentUtils()).createRequest(current);
gs.addInfoMessage(gs.getMessage("Request {0} was created", incidentRequest));
//gs.getMessage('Problem created from Interaction {0}', current.number));
//gs.addInfoMessage(gs.getMessage("Request {0} was created", current.number)));
//gs.addInfoMessage('Problem created from Interaction {0}', current.number));+
//gs.addInfoMessage(gs.getMessage("Request {current.number} was created", current.incidentRequest));
// gs.addInfoMessage(gs.Message("Defect {0} created",request.number));
current.state='7';
current.work_notes="Created REQ";
current.close_code='6';
current.close_notes="Created REQ";
current.update();
//////////var you_are_elle_path = 'sc_request.do?sysparm_incident_id=' + current.sys_id;
/////////action.setRedirectURL(you_are_elle_path);