Update the Tag value in incident form through API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
In incident form can we add Tag value through API ? What is the possible or different way through API to do this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
36m ago
Hi @karishmaafr,
There's no tag field on the incident table itself. Tags sit in their own tables and get linked to the incident, so what you're really doing through API is an insert, not a form update. Same logic whether it's a background script or an external call:
- the label table holds the tag itself, query it by name and create it first if it doesn't exist
- the label_entry table is the actual link: set label to the tag's sys_id, table to "incident", and table_key to the incident's sys_id
- the Table API hits label_entry the same way if you're doing this from an external integration
One thing to watch: table and table_key on label_entry are ACL-locked to the maint role out of the box, so a non-elevated script or scoped app can insert the record fine but those two fields come back blank. Other folks have hit this exact issue on the community, and the fix is a custom ACL granting write on those two fields to whatever role your integration runs as. There's also a good writeup on the scripted side of tagging here if you want to see it done in a business rule instead of a raw API call.
Thank you,
Vikram Karety
Octigo Solutions INC