System maintenance: clear down email logs on sub-production

instURL= gs.getProperty('glide.servlet.uri');
if (instURL.indexOf('https://PROD.service-now.com') > -1) {
//--NOT TO BE RUN ON PRODUCTION
        gs.print('do not run on prod');
    }else{


var gr=new GlideRecord('sys_email');
gr.addQuery('type!=received^ORtype=NULL');
//gr.query();
//gs.print(gr.getRowCount());
gr.deleteMultiple()
}

Comments

Popular posts from this blog

GlideRecord setValue

variable advanced reference qualifier example

URL link in addInfoMessage