How to clone a service request (or an incident) and attach all the related data to that clone?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2016 12:40 PM
Just wonder if anyone has the answer for the following requirement/ask:
Goal:
Clone existing records (mostly service requests or incidents) along with all the related data attached to them, and then transfer the cloned records to another "non-ServiceNow" systems via web services.
Why do you need to clone existing records?
Due to limited time and resources, the other "non-ServiceNow" systems can only accept "new" records during creation.
Many thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 10:54 AM
Just attached the xml for this UI action downloaded from this share url: https://share.servicenow.com/app.do#/detailV2/3aa3eee72bf5e1004a1e976be8da1590/overview
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 11:46 AM
if y ou build a list view of the table that just shows the records you want to import... and then right click.. on the header and choose export xml.. y ou should be able to import that into another instance...
the only real issue i see is this type of expot isn't going to include anything in related lists.. but for incident/requests should work fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 06:16 PM
Just a little clarification: the goal is to perform the following via UI Action on the current record (incident, request, etc.):
- Export itself to one pdf file (in default view, including all field updates and all notes from journal fields, plus all field updates and all notes from journal fields from all of its related records, such as request+request item+catalog task; incident+related incidents/problems/changes. etc.)
- Attach the pdf to itself
- Clone itself to a "net-new" record, including that pdf file
- Give user a chance to review/update the "net-new" record, attach new files to it, in order to meet the requirement for the next two steps
- Give user a chance to email the "net-new" record (including all attached files)
- Export the "net-new" record to a third party system via web services (including all attached files)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2016 05:40 AM
Hi ,
Were you able to develop something to fix the issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2017 02:11 AM
Hi wql, try the below script
//this is something you can write in an UI action or a business rule
current.number = "";
var newIncident = {};
newIncident = current;
//you can change fields such as
newIncident.state = 0;
newIncident.opened_at = new GlideDateTime();
var sysId = newIncident.insert();
gs.addInfoMessage("Incident "+newIncident.number + " created");
action.setRedirectURL(newIncident);