How to create a case from incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2019 12:18 AM
How to create a case from incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2019 12:24 AM
Hello Sri,
What is a case here? Is it a custom table?
You can create a record using below code:
var gr = new GlideRecord('table_name');
gr.initialize();
gr.name = 'first to do item';
gr.description = 'learn about GlideRecord';
// you can set any field values using gr.fieldName = 'values you want to set'
gr.insert();
Reference:
https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=r_GlideRecord-initialize
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade
Abhishek Gardade

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2019 12:28 AM
Hi Sriram,
You can create a UI Action: Create Case that appears on Incident state & configure script as below.
var gr = new GlideRecord('sn_customerservice_case');
gr.short_description = current.short_description;
gr.description = current.description;
var customerservicecase= gr.insert();
GlideSysAttachment.copy('incident', current.sys_id, 'sn_customerservice_case', customerservicecase); //copies attachment if any can be commented if required.
current.u_incident= customerservicecase;////Considering there is a custom Incident field on customer service form that copies the sys_id of incident.
current.update();
action.setRedirectURL(gr);
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2019 01:40 AM
Hello Sriram,
Please go through below link,
https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=r_GlideRecord-initialize
Hope your problem will be solve.
Thanks,
Monali Patil
mark as Helpful or Correct on the impact of response.