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…
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
Yes, sorry, I meant to say we tested with 19.2.0 (I wonder where I picked up 18.4.2. ) 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.
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.
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:
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.
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).
Got same issue here. Works perfectly fine for RPA-devlopers, but when i try to run it in unattended mode i get " Attempted to access an element as a type incompatible with the array."
I am not sure if its an access issue or problems with the activity from v22.10.4
Wouldnt i get another type of error if it is an access problem?
Just a small question - does the unattended machine have permission to access the Jobs data in Orchestrator? (I’m talking about the permissions of the Robot user associated with that machine).