- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2022 04:06 AM
Hi,
I would like to extract all the incident list assigned to specific assignment groups. I have an endpoint like:
url = 'https://instancename.service-now.com/api/now/table/u_incident'.
When I'm trying to add the sysparm_query, the endopist doesn't react on the provided query. Regarding to this, I have two questions:
1. How to check ID Assignment Group? How sould I put that ID in sysparm_query?
url_test = 'https://instancename.service-now.com/api/now/table/u_incident?sysparm_display_value=true&sysparm_query=active=true^assignment_group.name=12392^state!=7&sysparm_fields=caller_id.email,assigned_to.email,priority,number,sys_created_by,state,active,short_description,assigned_to,sys_created_on,resolved_at,subcategory,close_code,assignment_group,category,sys_created_by,opened_by,category,sys_id,caller_id,sys_updated_on,sys_updated_by'
2. How to create a query for fields like:
- ['u_assignment_group']
- ['u_number']
- ['u_action']
- ['sys_updated_on']
- ['u_urgency']
- ['sys_created_by']
- ['sys_created_on']
- ['u_problem_type']
- ['u_service_offering']
- ['u_opened_for']
- ['u_short_description']
- ['u_contact_type']
Thanks
Solved! Go to Solution.
- Labels:
-
Multiple Versions
-
Reporting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2022 04:13 AM
Hi,
you can form the encoded query and use it in sysparm_query
Didn't get your question
what's not working?
I could see you are using table as u_incident so are you using correct field names in query
Should it be not u_assignment_group etc?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2022 04:13 AM
Hi,
you can form the encoded query and use it in sysparm_query
Didn't get your question
what's not working?
I could see you are using table as u_incident so are you using correct field names in query
Should it be not u_assignment_group etc?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2022 04:42 AM
Hi Ankur,
You're right! I've formed the query based on the endpoint fields:
url_query = 'https://instancename.service-now.com/api/now/table/u_incident?sysparm_display_value=true&sysparm_query=active=true^u_assignment_group.name=12345&sysparm_fields=u_assignment_group,u_number,sys_updated_on,u_urgency,sys_created_by,u_contact_type,u_short_description'
But the u_assignment_group.name doesn't react, still, I'm getting all the data from various assigned groups. Could you please navigate me how to check the Assignment Group name (id number)? I've tried to use statement LIKE in the sysparm_query, with the regular Assignment Group name, but doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2022 04:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2022 04:30 AM
Thanks, but I haven't access in the SNOW UI to the REST API explorer. I have received only the endpoint 🙂