Orchestrator Get Jobs by "Key" Fails

I have even seen others come across same issue in form and no answer was ever found (from the posts I saw).

Anytime you try and filter jobs by key you get the following error

/odata/Jobs?$filter=Key eq ‘[job key]’
/odata/Jobs?$filter=contains(Key,‘[job key]’)

{

“message”: “Invalid OData query options.”,

“errorCode”: 1000,

“resourceIds”: null

}

However using ReleaseName,source and other keys works just fine with the filter.

Please advise why this fails.

Hello!

Please try to specify the key without quotes:
GET /odata/Jobs?$filter=Key eq acb123-acb123-abc123-acb123-abc123

1 Like

Hi @Mateus_Cruz,

Not quite sure if I understand how to enter your sample, I mean, is that query going inside the ‘Filter’ property ? or how do you use that query and which activity property in Studio plz?

Be Safe!

Hello!

It depends on what you are using to make the HTTP requests. The API can receive requests from any tool (not only from UiPath products), like cURL or Postman.

If you’re using UiPath Studio, then you can use the HTTP Request activity to make requests and specify the endpoint (including filter) as a string in the EndPoint property.
If you’re using the Orchestrator HTTP Request activity, then you use the RelativeEndpoint property instead.

For more details, please check the documentation: Building API Requests

1 Like

Hi @Mateus_Cruz,

Good info about the APIs, is just that I thought it was another way to include a query inside the ‘Filter’ porperty in the ‘Get jobs’ activity and thought it was interesting.

BE Safe!

If you’re using the Get Jobs activity, then specifying Key eq acb123-acb123-abc123-acb123-abc123 in the Filter property should be enough.

2 Likes

Good morning @Mateus_Cruz,

Let me take the chance to ask for the following in re the ‘Filter’ property in the ‘Get Jobs’ activity. How do make a multiple query in one line?. I could not do it so I had to made 2 separate activities. Of course tried different options but kept getting the usual ‘Bad request’ when ever you have a syntax error.

I tried to use one of the query from a post but could bot make it work.

This is my query:

" Release/Name eq ‘“+ ProcessName1+”’ or Release/Name eq ‘“+ ProcessName2+”’ "

Be Safe!

The Filter property accepts the same OData syntax used if you make the request on Swagger or Postman.

Your query worked fine for me:

1 Like

Thx @Mateus_Cruz,

Probably I sent the working one, if I find the one throwing error will share!