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 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