Update Set

Mark Wood
Tera Contributor

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.

4 REPLIES 4

Samaksh Wani
Giga Sage
Giga Sage

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

Danish Bhairag2
Tera Sage
Tera Sage

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

 

Hello @Danish Bhairag2 i tried it but its not working.

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