Get Job Folder Details to Create Email Notification

Hi all,

As I keep learning every day, and keep reading related post to this new inquiry I could not find any specific. I’d like to get the info from Job Folder at Orchestrator, specifically the Details inside since I’m looking for the Info ‘Job completed’ which means the job was successful. Plz see the images below.

As usual I and mentioned before I read many post and tried a few xamls’ but no specific solution and from ‘Get Jobs’ activity which is great I keep getting error :

“Get Jobs: Operation returned an invalid status code ‘BadRequest’” and no specif solution for it as well so I have to ask again.

img1 img2

Thanks in advance for any suggetions and Be Safe!!!

1 Like

@loginerror @ovi @ClaytonM please help me.

So far no response from anyone from the Forum or anyone who works for UiPath.

I found they way someone else requested your help in anothe post so I thought I’d give it a try.

Thanks in advanced!

1 Like

If you go to ‘Roles’ in Orchestrator where you set up the access for each role… ‘Robot’ role should have View, Edit, and Create access selected (FOR JOBS). Otherwise, a robot can’t use Start Job or Get Jobs activities.

If have any other related quetions, feel free to ask. I hope the above suggestion resolves your error.

Regards.

2 Likes

Hi Clayton,

Thanks so much for replying. For that part all is good Clayton, I have done some research as the Post guidelines and good practice indicate before submitting a post and found the info you have provided.

The help I need is how to actually build a Sequence to reach the info I provided on the images on my post.

•How can I get that info using a xaml in Studio please?
•Has anyone before has accomplished that?
•Is it possible to do it with Studio?

Thanks so much again, looking forward for your thoughts…

1 Like

Here is an example of how I use Get Jobs activity in order to start the robot on multiple robots from the individual process:

If you adjust the filter so it checks the state for “Successful”, then you can get the successful jobs for a specific process. You can also use the Top property to only select the first one or something (I’m assuming it starts from the latest jobs, but am not sure).

Regards.

2 Likes

Hi Clayton,

Thanks for the information, I’ll try it and let you know how it goes…

Regards,

1 Like

Hi Clayton,

Is this snip from RE Framework, I see that ‘config’ variable so it must be reading it from ‘Config.xlsx’.

What if I’m not using RE Framework, what should I use instead of that ‘Config’ var plz?

Regards,

1 Like

Technically, I’m getting the Process Name from the project.json file, then storing it in the dictionary with all my settings.
image

where the json filepath is just “project.json” so it uses the relative path (current directory).

It desieralizes it and pulls in the “name” value from the project.json file.

You can use any method though, like store the process name in a regular variable/argument or however you choose. Pulling it from the project.json however allows it to be automatic, so if you change the name, no code changes are needed.

Regards.

2 Likes

Great code Clayton,

With respect, I’m not that expert and I think you’re assuming I would know where that json comes or is located jeje. I know we have a config file when using RE Framework and how we can save o put info there so to be read from the Dictionary but not sure where or how to get that Json first. I’ve heard about json in general but in this case I would not know before trying to work with the json file where is it or is located my friend.

•Do you have a sample that I can try on in my Studio and analyse the insights to get a good picture please?

Also, I do remember I was checking the ‘Get jobs’ activity before with some of the posts here at the forum and at the end I kept getting this error from Studio when trying to run that activity:

Get Jobs: Operation returned an invalid status code ‘BadRequest’

Regards,

1 Like

If you get an error, it’s typically because of 1 of 2 possibilities:

  1. Access needs to set in Roles for Robots
  2. ProcessName_Environment is wrong

For you, it might be #2 issue. So if you get an error, check the process name and environment before it goes to Get Jobs to ensure it is exactly what it is named in Orchestrator.

2 Likes

Calyton,

On the Job folder the ‘Environment’ name shows as the image below but if I click details there is no info from it:

image

Don’t know why is that

Regards,

1 Like

I’m not sure, but you should look in the Processes section to get environment that is tied to the process.

If a Robot is not in an environment, like “Dev-Bot”, then check the Environment section and add the robot to the environment. And if it already is selected in that Environment, then the details is just bugged.

Like I said, though, you should get the Environment for the Process in the Processes section.

If you any other questions on how that works, let me know

Regards.

1 Like

Thanks Clayton,

It seems Environmet has both my robots inside.

Should I change the robot from Studio to ‘Test’ or ‘Unattended’ ?

Processess seems good

•So, any chance is something else?
•BTW, Do you have the xaml for the code with the json ?, I’d like to see it more in detention.

I saw you used the code in other post which is great:

Regards,

Hi Clayton,

Did you see the last response?, everything is Ok as the Environment sections.

•Do you have with you a .xaml sample for a Get Jobs activity plz?
•Any post on the forum I have missed with a specific solution about this?

Thank you!

1 Like

Hi, bad request error code means your request syntax must be wrong, i see your environment has a blank space in the middle and maybe this is causing you troubles… can you rename it for a test? Are you inputting any filter?

1 Like

Hi Bruno,

Let me change the ‘Environment Name’ to no space in between and I’ll let you know…

Hi Bruno,

I changed the name to no space in between, still having this:

image

This is ‘Get Jobs’ property panel info, all simple, nothing strange:
image

Jobs Details still not showing ‘Environment’ name which should be just: Environment

image

Regards,

Hi,

I think the BadRequest is happening due to the State condition, where it can’t find the state, also possibly due to syntax.

I just helped my associate with same issue.

When I changed it to this:
"(State eq 'Successful')"
the BadRequest error stopped, unless it was coincidence.

You can then also add the Release/Name condition next to it.

So hope that works. Let us know.

Regards.

1 Like

I’m trying now, thx Clayton. BTW, what if we remove the ‘filter’ and just get anything that finds?

I’m actually not sure if it gets all jobs. I also think there is a limit of 100 like the Get Queue Items limit - I’m not sure on that either though.

I would try to get Filter working, if I were you :smiley: