Running into a challenge trying to update a security role contextual expression via a workflow.
I have successfully created a role using a workflow and, separately, updated the name via a workflow so I feel relatively confident I know how updates work in general.
However, I keep getting an ‘unknown field’ error, meta not found, when attempting to update the contextual expression.
meta is found in the initial scope just like name and handle, which I can update successfully.
Are we intentionally not able to update the meta field via a workflow, am I doing something wrong, or is this a bug?
Thanks.
You can update the meta of a security role by performing a PUT request on the /api/system/roles/{roleID} endpoint.
Ideally the field would just be directly available to edit in a workflow expression, like the name or handle, but this is a path forward.
Example body of the request from the api docs
{
“name”: “string”,
“handle”: “string”,
“members”: [
“string”
],
“meta”: “string”,
“labels”: “string”
}
Example body below. I’m performing this on a brand new role so there are no members I need to include. If you don’t set the value of a field, like the name / handle / etc., it will update the role and the name, handle, etc. will be empty.
{
“name”: “temp”,
“handle”: “role_temp_tester01234_01”,
“meta”: {
“context”: {
“resourceTypes”: [
“corteza::compose:record”,
“corteza::automation:workflow”,
“corteza::compose:page”
],
“expr”: “has(resource.values.ExampleField, userID)”
}
}
}