Is there a way to bulk update tags on CI's

SeanM1
Tera Guru

Hi all,

 

Is there a way to bulk update a tag to a large number of CI's. I can't find the bulk update process in online documentation or in other community posts. I have over 2k records to update.

I understand they records live in the label_entry table.

2 REPLIES 2

Jorn van Beek
Tera Guru

Depending on the update you are looking for there are multiple ways of doing it.

but most likely you need a script to update them.

swarnargha1
Giga Contributor

Please run the below background script:

var current= new GlideRecord('incident');
current.addEncodedQuery('caller_id=62826bf03710200044e0bfc8bcbe5df1'); or use any other query which satisfies your case
current.query();
while(current.next()){


var labelEntry = new GlideRecord('label_entry');
labelEntry.initialize();
labelEntry.title = 'Test- ' + current.short_description;
labelEntry.table = 'incident';
labelEntry.label = '6c361e12471331007f47563dbb9a7135';
labelEntry.url = 'incident.do?sys_id=' + current.sys_id + '&sysparm_view=';
labelEntry.table_key = current.sys_id;
labelEntry.read = 'yes';
labelEntry.insert();

}