How to get 'sys_tags' field value on Incident API for all the tagged incidents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2019 08:45 AM
Hi All,
I have got a requirement to share incident API which should include Tags field too.
The API shows sys_tags column on Response part but the value is not displaying, unless if the Incident is tagged to the logged in user account.
For example: I have tagged an Incident as System Administrator and ran API in different login, the value is not retrieved. I got the below response.
but same API works fine for System admin
I got suggestions like create custom field and copy Tag values by querying from label_entry table, we are not trying it.
Can somebody let me know if we have any role or something which can be granted to our web service user account.
Thanks in Advance!
Savitha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2019 03:32 PM
Hello,
I think these values are taken from Tags table (label.list in the app navigator if not Tags under System definitions)
If there are concrete existing labels, then an alternative can be to change: "Viewable by", to everyone and try again.
Possible configuration directly on this table if this approach works, and if you want dynamic results from the API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2019 08:44 AM
Hi,
I think the workarround will be creating a new field to store the tags. To do that follow the below steps:
1)Create a field on incident table.
2)query on "label_entry" table "table_key" field with incident sys_id.
3) Get label.getDisplayValue() and add in the field you created on incident table.
Iam not sure that there is a way to get the tag field directly!.
-satheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2019 08:49 AM
check the below link, it may help you. I think the tags follow some rules for visibility. thats why it is not showing for all users as admin.
https://docs.servicenow.com/bundle/madrid-platform-user-interface/page/use/common-ui-elements/concept/c_Tags.html
-satheesh
