Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Fetch incidents based on short_description

Barun
Kilo Contributor

In ServiceNow, we already have a rest API to fetch incident based on short_description like below example.

/api/now/table/{tableName}?short_description=short_description

I want to send a short description as a regex. For example, if I send "error" as short_description I want to get all the incidents to which "error" word is part of. Please suggest if there is any way to achieve this.

 

Thank you

1 ACCEPTED SOLUTION

JennyHu
Tera Guru

You can use an encoded query string where short description contains "error".  The API call would look like this:

/api/now/table/incident?sysparm_query=short_descriptionCONTAINSerror

View solution in original post

2 REPLIES 2

JennyHu
Tera Guru

You can use an encoded query string where short description contains "error".  The API call would look like this:

/api/now/table/incident?sysparm_query=short_descriptionCONTAINSerror

It looks like this querry returns an empty string / structure:

 /api/now/table/incident?sysparm_query=short_descriptionCONTAINSmytext

 

{
    "result": []
}

 

despite 2 REQuests just registered