GetJobs or OrchestratorHttpRequest with Org Units

Hi,

we recently started using Organizational Units (OU) and this seems to cause some issue with certain scripts. For example, GetJobs activity when run in Test environment seems to work, but not in production. I read that with OU’s you need a new header in the request (X-UIPATH-OrganizationUnitId) and indeed if I test with this with Postman it works and returns what is expected.

But what is the preferred way to incorporate this into an UiPath activity to use it in a script? Is it possible to use UiPath.Core.Activities.GetJobs or UiPath.Core.Activities.OrchestratorHttpRequest when OU’s are in use?

Edit: just found this: https://activities.uipath.com/docs/release-notes-system#section-new-features-and-improvements which seems promising (“The Orchestrator HTTP Request activity has been improved, and is now able to retrieve the headers of the requests it performs.”). I just don’t get why we would be interested on the headers of the request as output. I’d assume we’d need to be able to modify the headers of the request itself?

We tested the newest version of UiPath.System.Activities (v18.4.2) and noticed we now cannot use UiPath.Core.Activities.OrchestratorHttpRequest at all, it just returns
Attempted to access an element as a type incompatible with the array.
By reverting back to older version it works, but still we are not able to retrieve Jobs as we cannot enter the OrganizationId.

edit: the normal http request activity is a viable workaround, but it would of course be nice to get these activities (OrchestratorHttpRequest and GetJobs) to work with Organization Units…:grinning:

Hi @Nautilus

Could you test it with the newest UiAutomation package 19.2.0? It would be a valuable feedback.
Please include examples of your request and the full error log.

Please don’t hesitate to contact our technical support for assistance here either :slight_smile:

Thank you for the reply.

Yes, sorry, I meant to say we tested with 19.2.0 (I wonder where I picked up 18.4.2. :slight_smile:) but got the errors so we needed to revert back. The error was:
"Orchestrator HTTP Request: Attempted to access an element as a type incompatible with the array."
After reverting back, the same activity worked again. Naturally we also tried to re-create the activity from scratch, but it did not help with 19.2.0.

I have a ticket (“00035477_GetJobs fails when Organizational Units are in use”) open about this issue as well, but I haven’t received any replies since 27.2. although I’ve sent a few replies myself after that.

In that case, you can always test it with the alpha/beta of 19.3 to check if it was already tackled :slight_smile:

I can confirm I’m getting this error in 19.3, using a robot that used to work fine in an older version from around the end of 2018. Apologies, not sure what version it was then.

However, reverting to version 18.4.2 has also resolved the issue for me.

Nautilus - did you ever resolve it on 19.2 or 19.3, or find out from UiPath where there might be lower level logs that provide anything useful to send to support?

Hi - we did not resolve this with 19.2 (and did not test with 19.3). From UiPath technical support they suggested debugging it further and then sending the logs, but we have not been able to do that yet.

Hello, I am experiencing an identical issue. v19.3 Orchestrator HTTP Request does not work at all with any JSON Payload argument. The error is the same as above:

Orchestrator HTTP Request: Attempted to access an element as a type incompatible with the array.

The only fix I’ve found is to downgrade to UiPath.System.Activities v18.4.2.

Thanks,
Greg

Hi Groelle, Nautilus - anyone had a chance to test if this bug is fixed in their environment with UiPath.System.Activities v19.4 yet?

No, unfortunately not.

Hi Kit, I have tried. Still have no way of successfully defining the OU used.

Do we have any solution to this? How to use OU in orchestrator http request ?

Hi @Rocki_Jan

The Orchestrator HTTP Request activity uses the context of the Robot that executes the process. As such, it will use the OU that the Robot belongs to by default.

For more advanced requests, you should use HTTP Request activity where you can specify an additional header:

x-uipath-organizationunitid: X

Can you please explain the JSON Payload argument in the activity?

I was hoping to use Orch HTTP Request activities and just change the default header to loop through all folders that the robot can see into.

Given that my reply is a bit dated, could you please let me know the version of the System activity package that you are currently using?

I feel like this interaction should have been incorporated in the latest version of the Orchestrator HTTP Request activities.

Hello,

Even when I run the process on my local computer using the Orchestrator HTTP Request, I can see all folders. But If I wanted to get all releases in each folder created in the tenant, my robot user needs to be added to every folder to see the “releases” (Which are just added packages)

I’m using 21.4.1

So yes, I’m hoping to be able to change the header of organizationunitid. But isn’t organizationunitid same as folder id? There’s already a folder Path parameter in the OrchestratorhttpRequest activity.

I’m a bit confused by your suggestion.

You’re correct that the organizationunitid is indeed the folder id.

I think it comes down to the access level required to fetch specific information. The Orchestrator HTTP Request activity will always only have access to what the robot itself has access to. So I believe it should be in theory possible to fetch extra information with the robot by using this activity if you grant that robot admin permissions. I didn’t test it though so I’m not 100% sure.

However, you could use the general Orchestrator API access with admin credentials and the generic HTTP Request activity to achieve it (and those API calls will for sure require you to provide the organizationunitid when necessary due to them covering the entire tenant).