- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2019 04:17 AM
How do I copy the incident using UI action ?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2019 04:20 AM
Hi,
Create an UI action and in the script, you can write something like below
var inci = new GlideRecord('incident');
inci.initialize();
inci.short_description = current.short_description;
//do this for other fields.
//if you want to copy work notes and comments, then you can try this
inci.work_notes = current.work_notes.getJournalEntry(-1);
inci.comments = current.comments.getJournalEntry(-1);
inci.insert();
action.setRedirectURL(inci);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2019 04:20 AM
Hi,
Create an UI action and in the script, you can write something like below
var inci = new GlideRecord('incident');
inci.initialize();
inci.short_description = current.short_description;
//do this for other fields.
//if you want to copy work notes and comments, then you can try this
inci.work_notes = current.work_notes.getJournalEntry(-1);
inci.comments = current.comments.getJournalEntry(-1);
inci.insert();
action.setRedirectURL(inci);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2019 04:21 AM
Hi,
Go through below thread, this will helps you.
Mark Correct/Helpful, if this helps you.
Regards,
Devyani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2019 04:26 AM
Hi,
you can refer below links for more information :
https://www.servicenowelite.com/blog/2014/2/24/copy-incident
https://www.servicenowguru.com/system-ui/ui-actions-system-ui/copy-ui-action-change-requests/
https://www.servicenowguru.com/system-ui/ui-actions-system-ui/copy-ui-action-change-requests-part-2/
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2019 04:32 AM
There is an OOB UI Action to Copy Incident. And the nice thing with the OOB one, it creates a new record but does not submit it, so you can fill out any needed mandatory fields before manually clicking Submit. Most custom UI Actions automatically submit the new record with fields left blank.