I am trying to add a tag to a service now incident, but I can't find any documentation for it anywhere. I have looked at the label and label_entry tables in the incident api. And I can not seem to tie an incident and a label together.
In theory, it should be possible to do this by creating a record in the label_entry table, providing the sys_id of the tag, table and sys_id of the record you'd like to associate the tag with. After a quick test:
POST /api/now/table/label_entry
{"label":"4f1094ff13162600973e70d66144b033","table":"incident","table_key":"0d97240e13aca600973e70d66144b03f","title":"Incident - INC0010018"}
I found that the table and table_key fields have write ACLs restricting access to users with the maint role. I don't have any info on why this is the case, but I suspect there may be a reason to avoid creating these records directly via API.
You could modify the ACLs or create a simple Scripted REST API that takes the tag, target record, and uses GlideRecord to insert the tag into the label_entry table. But I don't have any info on what side effects this may introduce.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With