Which filter options do I have with Get Jobs activity?

hi,

I know that I can filter on state of processes, e.g.: “State eq ‘Running’ or State eq ‘Pending’”
But what about more advanced stuff like: “substring(Robot/Name, 0, 12) eq '”+processName+“'”
I have been looking a little at URI Conventions (OData Version 2.0) · OData - the Best Way to REST but I’m not sure how the logic can be transfered to UiPath Studio.

As an input I have a process name: “Process_0025”
The full name of the process is “Process_0025_Test_ProdEnvironment”
I would like to get an output of the latest executions of this process.

How can I filter to only get a specific process, using a limited input?
Or how can I best get the full process name, including environment, when I only have the first part of the name?
I need the full name to use the start jobs activity.

Filter : “contains(Robot/Name,%27”+processName+“%27)”

1 Like

To help others

This is the exact thing I wanting. First 12 characters of Process name needs to be the same as ProcessNameInput. and getting the latest jobs:
"substring(Release/Name, 0, 12) eq %27"+ProcessNameInput+"%27&$orderby=CreationTime%20desc"

This is a more generic version of the above. Process name should only contain the same as ProcessNameInput, and also sorted by the latest jobs:
"contains(Release/Name,%27"+ProcessNameInput+"%27)&$orderby=CreationTime%20desc"

Get recent jobs from a specific Robot machine:
"(contains(Release/Name,%27_%27))%20and%20(contains(Robot/Name,%27"+RobotPCName+"%27))&$orderby=CreationTime%20desc"

4 Likes

Where is this “Release/Name” coming from? I’m kind of lost as where can I see the data that the filter will be apply to.

1 Like

Sorry for late reply.
Release/Name is simply the name of your process

Hello @Dan_Wulff_Andersen,

Could you please help me to understand how to filter Jobs by duration. E.g., to retrieve only Jobs with duration more than 00:00:07 (7 sec)

Many thanks

can anyone please tell how can i get the count of running job for specific process

Hi @UR_UDAY_KIRAN,

Not sure if it is what you’re looking for but lets say you have a ‘Getjobs’ activity where the output variable name is ‘jabRes’ so it will give you the count as the img below:

image

Hi @krunal_patel,

I was wondering what does ‘%27’ mean or where can I find those keywords list plz?. I’m trying to use that query but not sure how to…

BE Safe!

It just means apostrophe ’

1 Like

Hey Dan,

I tried running this in Studio but I wasn’t able to find any results"

“/odata/Jobs?$filter=contains(ReleaseName,%27”+“MonthlyUsageUploadFiles_Dispatcher”+“%27)&$HostMachineName eq '” + Environment.MachineName + “'”

I tried Release/Name and ReleaseName and checked the name of my package: image

I’ve assigned my robot user the view logs role as well too and I for sure have ran this process before with the same VM/Machine…

Thanks!

How can i filter by job priority?