Additional comments and attachments are not being copied.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2024 11:26 PM
var change = new GlideRecord("change_request");
change.short_description = current.short_description;
change.description = current.description;
//change.cmdb_ci = current.cmdb_ci;
//change.priority = current.priority;
change.comments = current.comments.getJournalEntry(-1);
change.requested_by = current.caller_id;
//var c = current.comments.getJournalEntry(-1);
//change.comments.setJournalEntry(c);
var sysID = change.insert();
//current.rfc = sysID;
//var mySysID = current.update();
var attachment = new GlideSysAttachment();
var copiedAttachments = attachment.copy('incident', current.sysID, 'change_request', sysID);
gs.addInfoMessage("Change " + change.number + " created");
action.setRedirectURL(change);
action.setReturnURL(current);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2024 01:27 AM
script provided by you people should work. I think there is some other issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2024 04:13 AM
hi @Community Alums
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2024 04:14 AM
Hi @Community Alums ,
Your code is incorrect, Can you brief us on the requirement.
As i see you are inserting a new record which obviously have no attachement in it.
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2024 06:39 AM
creating a change request from incident record using UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2024 08:38 AM
Hi @Community Alums ,
Please refer to below thread:
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda