Unable to PATCH role owner in workflow

Hi all,

I have a workflow that will update the role when a user goes into removeaccess lifecycle state with that users manager. The workflow is working up until the PATCH HTTP Request patch-role | SailPoint Developer Community. Here is the body I’m using

[{“op”:“replace”,“path”:“/owner”,“value”:{“id”:“{{$.getIdentity1.id}}”,“type”:“IDENTITY”}}]

but I get this error Failed: 400 - 400 Bad Request - {“messages”:[{“localeOrigin”:“REQUEST”,“text”:“Illegal value \”{{$.getIdentity1.id}}\" for field \"identityId\\

I then tried removing {{}} and used [{“op”:“replace”,“path”:“/owner”,“value”:{“id”:“$.getIdentity1.id”,“type”:“IDENTITY”}}] and instead get this error

400 Bad Request - {“messages”:[{“localeOrigin”:“REQUEST”,“text”:“Referenced IDENTITY \”$.getIdentity1.id\" was not found.\

The other HTTP requests I have in other workflows are working with objects wrapped in {{}} to use a workflow value. None of them however use the role api. Any help would be appreciated as I’ve played around with the body and nothing seems to be working.

Failed: 400 - 400 Bad Request - {“messages”:[{“localeOrigin”:“REQUEST”,“text”:“Illegal value \”{{$.getIdentity1.id}}\" for field \"identityId\\

This looks like the ID variable is not correct. In workflows, if you provide a variable like {{$.getIdentity1.id}} and the expression doesn’t evaluate to a valid value, it will just leave the {{$.getIdentity1.id}} as plain text, instead of a blank or null. You can double check in the workflow execution, but I’m betting that the input for the HTTP operation that is patching the role doesn’t have a $.getIdentity1.id

Did you free type the $.getIdentity1.id or did you use the variable selector? Unless you have 2 Get Identity actions, it should not be getIdentity1, it should instead just be {{$.getIdentity.id}}

I agree that it looks like your workflow is not resolving that expression, causing the error for the request. I would start reviewing how the workflows handle them.

Thanks for the replies. I verified what you mentioned and the tpying is correct. Interestingly, I removed the loop and hardcoded the role ID in the call and it worked so seems the loop is configured incorrectly. I’ll have to rework this. Thanks for the input.

Ah, you have a loop - recall that variables that are configured outside of a loop are not available within the loop, unless you add them to the context. I like to use a define variable step to add all the values I might need inside the loop, then add that define variable itself to the loop context.

Hi Matt, I appreciate your reply as I was unaware of this. I’m going to mark your post as the solution as this is exactly what I needed to do to fix my issue. Thanks!

I have the similar issue even after using the variable selector, please provide your insights.

Hi, in my case for loop context I only have {{$.loop.context}} without the name of the variable.

I got that working, thanks.