Update Set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2023 03:52 AM
Hello Experts,
I want to copy customer updates from one update set to another I don't want to move it; I want a copy of it how can I achieve this please guide me thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2023 03:58 AM
Hello @Mark Wood
Whichever the customer updates you want to copy into another update set , You have open them in new tab and copy their xml code and add into the new customer update of new Update set,
Plz mark my solution as Accept, If you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2023 04:27 AM
Hi @Mark Wood ,
Plz try this script n check. Please test it first in lower environment
var inuser = new GlideRecord('sys_update_xml');
inuser.addEncodedQuery('update_set=b8869090477131100dd42b92e36d4304');// Please use your Update set Sys ID
inuser.query();
while (inuser.next()) {
inuser.initialize();
inuser.type = inuser.type;
inuser.view = inuser.view;
inuser.update_guid = inuser.update_guid;
inuser.target_name = inuser.target_name;
inuser.name = inuser.name;
inuser.action = inuser.action;
inuser.update_set = 'enter ur new Update set sys ID';
inuser.comments = inuser.comments;
inuser.application = inuser.application;
inuser.category = inuser.category;
inuser.payload = inuser.payload;
inuser.payload_hash = inuser.payload_hash;
inuser.sys_recorded_at = inuser.sys_recorded_at;
inuser.replace_on_upgrade = inuser.replace_on_upgrade;
inuser.insert();
}
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2023 05:41 AM
Hello @Danish Bhairag2 i tried it but its not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2023 05:47 AM
Hello @Mark Wood ,
Please try updated code i tested it works
var inuser = new GlideRecord('sys_update_xml');
inuser.addEncodedQuery('update_set=b8869090477131100dd42b92e36d4304');// Please use your Update set Sys ID
inuser.query();
while(inuser.next()) {
var gr = new GlideRecord('sys_update_xml');
gr.initialize();
gr.type = inuser.type;
gr.view = inuser.view;
gr.update_guid = inuser.update_guid;
gr.target_name = inuser.target_name;
gr.name = inuser.name;
gr.action = inuser.action;
gr.update_set = '0926d3af477e71100dd42b92e36d4304';
gr.comments = inuser.comments;
gr.application = inuser.application;
gr.category = inuser.category;
gr.payload = inuser.payload;
gr.payload_hash = inuser.payload_hash;
gr.sys_recorded_at = inuser.sys_recorded_at;
gr.replace_on_upgrade = inuser.replace_on_upgrade;
gr.insert();
}
Thanks,
Danish