Is there a way to bulk update tags on CI's
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2022 04:28 PM
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.
Labels:
- Labels:
-
Instance Configuration
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 11:08 AM
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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 12:04 PM
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();
}