how can i retrieve the updateset and commit using scripted rest API

Rama26
Tera Contributor

Hi All,

 

Below is the script i written to retrieve the update sets from dev to stage.

var storyUpdateSets = "Auto-Deployment"

this.config.set('update_sets', storyUpdateSets);
var updatSource = gs.getProperty('Autodeployment.update.source');

function getCompletedUpdateSetsFromRemote(storyUpdateSets) {
            //get data source
            var id, gr = new GlideRecord('sys_update_set_source');
            gr.addQuery('name', storyUpdateSets); //name of the target environment
            gr.query();
            if (gr.next()) {
                id = gr.getUniqueValue();
            }
            //define worker and required paras
            var worker = new GlideUpdateSetWorker();
            var sys_id = id;
            //initiate worker
            worker.setUpdateSourceSysId(sys_id);
            worker.setBackground(true);
            worker.start();
            //start an one time schedule
            var progress_id = worker.getProgressID();
        }
i written scripted rest api. using above script it's retriving all updatesets in dev but i need only particular updateset that given in body. how can i achieve that.
 
1 REPLY 1

Kieran Anson
Kilo Patron

GlideUpdateSetWorker has a function called 'setUpdateSetSysId' you can try and see if that function allows you to pass a remote-sysId to restrict what is retrieved