The Zurich release has arrived! Interested in new features and functionalities? Click here for more

REST Table API Catalog Task

Nanasaheb
Kilo Contributor

I am using Table REST API to fetch the task numbers, currently i am able to fetch tasks by applying two conditions that is #Assignment_Group and #State. Now I want to fetch data for fetching data based on 3 conditions (Assign group, state and #Item). i tried to do but  no luck. 

"XXXX/api/now/table/sc_task?sysparm_query=" \
"assignment_group%3Db045df67db2dc010a05b298a48961yh6%5Estate%3C3&" \
"sysparm_display_value=true&" \
"sysparm_exclude_reference_link=true&" \
"sysparm_fields=number"
Above link is working for me.

Attaching SS which contains all details about fields.
in attached image i want to apply filter on Assignment Group, State and Item field at a time.

If anyone know how to use conditions then please help to sort out.


Thank You!

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

give query as below

XXXX/api/now/table/sc_task?sysparm_query=" \
       "assignment_group%3Db045df67db2dc010a05b298a48961yh6%5Estate%3D3%5Erequest_item.item%3D<itemSysId>"

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

give query as below

XXXX/api/now/table/sc_task?sysparm_query=" \
       "assignment_group%3Db045df67db2dc010a05b298a48961yh6%5Estate%3D3%5Erequest_item.item%3D<itemSysId>"

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thank You for your response, but still it returns all tasks present in that assignment group. 

Tried with Postman tool but no luck. 

Hi Nanasaheb,

Is it not taking into consideration the state and request_item.item in the query you are using?

Can you share the query which you are running?

Regards

Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Nanasaheb 

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

If not, please let us know if you need some more assistance.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader