Hello, I fell a little lost in trying to change the workflow status of an entity.
The workflow is the “default” fibery workflow with Open, In Progress, Done.
With the query below I changed the Name [enum/name] of the whole
workflow state and not the state of the entity.
fib_task[“workflow/state”][“fibery/id”] =
ID of the workflow status I got from the query I do initially to get entity information
{“workflow/state”: [“fibery/id”, “enum/name”]}
@Chr1sG - can I ask - what is the name of the workflow entity and what is its structure? I assume the only way to obtain this is in js by reading the workflow entity and building an array …
Workflow is itself a database, but a ‘hidden’ one.
It has fields like any other db (Name, Creation Date etc.) and has a relation to its owning type.
In the schema, the name of the workflow type is typically something like this: workflow/state_SpaceName/OwningType
The workflow options are entities in this database, so you can query them just like any other entity in the workspace.
Not sure what the ‘this’ you want to obtain is? If you want to read the value of state, it is available when you read the entity, e.g. if you execute this:
const fibery = context.getService('fibery');
for (const entity of args.currentEntities) {
console.log(entity);
}