i want to delete these two versions?

lakng
Tera Contributor

i dont want to see the versions here,

perviously there were no versions there. by mistake it got updated by me. 

then these versions are showing like this.

i dont want to see this.

there should be no versions.find_real_file.png

1 ACCEPTED SOLUTION

var gr = new GlideRecord('sys_update_version');
gr.get('9725bf11db9d6740e4d95740cf9619f0'); // pass the sys_id of those version one by one and run it in background script.
gr.deleteMultiple();

View solution in original post

13 REPLIES 13

i would suggest validate it on lower environment and see this ui action is exact same or not

script, condition etc.

then if it's fine run that script in background script .

i have check in lower environment,

there is no versions at all for this UI Action.

it will be same as all environment , if i will remove these verions

 

i was saying you to check the script and condition. is that exact same with prod ui action?

Hi,

If you really want to delete the version, then copy below script in background script and hit Run :

(Before running verify the code on my dev instance it's working )

var gr = new GlideRecord("sys_update_version");
gr.setWorkflow(false);
gr.addQuery("payload_hash","-1841342483");//Open particular version version and copy payload hash value
gr.setLimit(1);
gr.query();
if(gr.next())
{
  gr.deleteRecord();
}

Let me now for other querries.

 

Mark if Correct/Helpful

Regards,
Ajay