I have to add conference tag in incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
Whenever an incident is assigned from abc to xyz we would like to add "Conference Room Issue" tag to the incident along with the existing configuration in flow and we are having flow for that catalog item.
Can anyone please help me how to add conference tag in incident.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Ankur Bawiskar,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
run the code in scripts background
var tagsArr = 'Conference Room Issue';
// Iterate thru the Array and create the Tags and Label Entries
tagsArr = tagsArr.split(',');
for(var i = 0; i < tagsArr.length; i++) {
var tagSysId = '';
var grTag = new GlideRecord('label');
grTag.addActiveQuery();
grTag.addQuery('name', tagsArr[i]);
grTag.addQuery('type', 'standard');
grTag.addQuery('viewable_by', '!=', 'me');
grTag._query();
if(grTag._next()) {
tagSysId = grTag.getUniqueValue();
} else {
grTag.initialize();
grTag.setValue('name', tagsArr[i]);
grTag.setValue('viewable_by', 'everyone');
grTag.insert();
tagSysId = grTag.getUniqueValue();
}
var grTagEntry = new GlideRecord('label_entry');
grTagEntry.initialize();
grTagEntry.setValue('label', grTag.getUniqueValue());
grTagEntry.setValue('table', 'incident'); // here
grTagEntry.setValue('table_key', 'incidentSysId'); // here
grTagEntry.insert();
}
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Ankur Bawiskar,
I have run above code in background script and given incidentSysId it is not adding conference tag to that incident.
I'm try both approach flow designer first and then business rule whichever will work I can show that.
Can you please help me to correct that.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
Can you please help me to correct business rule to add conference tag to that incident.
var tagsArr = 'Conference Room Issue';
// Iterate thru the Array and create the Tags and Label Entries
tagsArr = tagsArr.split(',');
for(var i = 0; i < tagsArr.length; i++) {
var tagSysId = '';
var grTag = new GlideRecord('label');
grTag.addActiveQuery();
grTag.addQuery('name', tagsArr[i]);
grTag.addQuery('type', 'standard');
grTag.addQuery('viewable_by', '!=', 'me');
grTag._query();
if(grTag._next()) {
tagSysId = grTag.getUniqueValue();
} else {
grTag.initialize();
grTag.setValue('name', tagsArr[i]);
grTag.setValue('viewable_by', 'everyone');
grTag.insert();
tagSysId = grTag.getUniqueValue();
}
var grTagEntry = new GlideRecord('label_entry');
grTagEntry.initialize();
grTagEntry.setValue('label', grTag.getUniqueValue());
grTagEntry.setValue('table', 'incident'); // here
grTagEntry.setValue('table_key', 'incidentSysId'); // here
grTagEntry.insert();
}
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Ankur Bawiskar,
Can you please confirm how to test in background script what changes I have to do in that.
Regards,
Nivedita

