Change as Requester in Custom Function
Is it possible to change roles for a technician or remove the technician role from a user? I am working on a workflow for offboarding users in SDP On-Prem 15240 and would like to automatically remove the permissions when a technician is being offboarded. This is the Deluge script I tried to achieve this, but it doesn't work.
- leaver = requestObj.get("udf_fields").get("udf_pick_27762");
- headers = Map();
- headers.put("TECHNICIAN_KEY", "valid-integration-key"); // Integration key has SDAdmin permission to achieve this.
- info leaver;
- removeTechRole = invokeurl
- [
- url: "https://servicedesk.domain.net/api/v3/technicians/change_as_user"
- type: PUT
- parameters: {"ids": leaver.get("id")}
- headers: headers
- ];
- return removeTechRole.get("changes_as_user");
I currently get an SSL Exception, but I do not get this if I run this using Invoke-RestMethod in PowerShell. Anything I'm missing? Or is this not possible?