Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Fetch the labels for tasks

NicolaeP
Kilo Expert

I need to fetch the details for each task from the Visual Task Boards.
While I can find most of the details needed using this endpoint:
`https://instance-name.service-now.com/api/now/table/vtb_card?sysparm_fields=sys_id,task,task.number,...`, 
I cannot access the labels I assigned to tasks on the UI.
I appreciate any help.
Thank you

1 ACCEPTED SOLUTION

NicolaeP
Kilo Expert

I found the answer in this thread:
https://www.servicenow.com/community/itsm-forum/how-do-i-lookup-tags-associated-with-any-task-record...
The path that helped me is this one:
"/api/now/table/label_entry?sysparm_query=table=vtb_card^label.nameINFeature,Idea&sysparm_fields=label.name,table_key"


View solution in original post

3 REPLIES 3

SteveMacWWT
Kilo Sage

I believe those are stored in the 'tags' field on the VTB card record. 

Thank you, Steve.

Actually, I have to search for the labels attributed to each task from VTB in the label_entry table.

NicolaeP
Kilo Expert

I found the answer in this thread:
https://www.servicenow.com/community/itsm-forum/how-do-i-lookup-tags-associated-with-any-task-record...
The path that helped me is this one:
"/api/now/table/label_entry?sysparm_query=table=vtb_card^label.nameINFeature,Idea&sysparm_fields=label.name,table_key"