var addTag = new GlideRecord('label_entry');
addTag.initialize();
addTag.setValue('label', grTag.getUniqueValue());
addTag.setValue('table', current.getTableName());
addTag.setValue('table_key', current.getUniqueValue());
addTag.setValue('title', "Tag title");
addTag.insert();
How to add Tags in Form using Script ServiceNow
Expert Edited question July 18, 2023