Get Job Folder Details to Create Email Notification

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

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.



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’


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.



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


Don’t know why is that


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


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:


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:


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

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




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.


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:

Nothing my frined, still same ‘Bad Request’. With or without ‘filter’ still same issue.

Good point about the limit but not is not interfering on it, is about not been able to connect o is nor reaching Orchestrator.

The ‘filter’ could be syntax but that part is good, which is why I removed it and still not getting to Orchestrator, must be something else definitely for which I’ve been reading about ‘bad request’ here and no specifics.

Can you show how it looks with the Filter in there?

Also, have you tried removing “Jobs” from the Misc properties?

Great, good idea, removing ‘Jobs’ is going through but, still showing no results


I think I was seeing the same thing, but didn’t test it enough to know why. When I added the Release/Name in the Filter and removed the Top, it was fine.

You can verify that Orchestrator has Jobs, but I’m wondering if it needs to be filtered more or something. Like I said, I haven’t tested it enough to know why.

The issue getting to Orchestrator is good but now is now showing the info. I have removed ‘top’ and added ‘Release/Name’ to filter with no ‘Jobs’ folder name or nothing at Misc properties

Make sure you verify Orchestrator that the process has jobs that are successful, that fall in the limit of 100 jobs. I would test using a different state too, so you know it works. Like instead of using ‘Successful’, use ‘Running’ or ‘Stopped’. That way, you can test that it’s working.

If you run a recent successful job, then test it, and it’s not pulling it. It’s possible the successful state is bugged or something. Let know if you find anything out on it, cause we might have same issue.