Actually there is a scripted way to do this:
for(var x = 0; x < item.project.children.length; ++x){
if(item.STATUS === "Cancelled"){
// get a handle on the target item behind the task
var ix = item.project.children[x].target;
/ EITHER this call:
ix.performWorkflowTransition(transID, 'COMMENTS') // pass the transID of the Wf transition you'd want to execute
// OR this call (recommended):
ix.performWorkflowTransitionByCustomID('CUSTOM_ID', 'COMMENTS'); // pass customID of the wf transition you want executed
}
}
As you may observe from above example, consider performing ONE of the two functions to move the desired WF transition forward. With it, the Status on project mgmt tab would respectively update for affected tasks. IMPORTANT: Keep in mind that scripts do have timeouts, so the number of traversals and tasks you can switch WF State will have some limit associated with it.
Nevertheless, my recommendation is to define a customID for each trans in Workfow Editor so that in code, can run the latter fuction thereby removing reliance on systemIDs and stateIds. As a good rule of thumb, an admin defining WF Maps should safely assume that those entities may be referenced by scripts. So use the CustomID(s) to refer to transitions/states to build reusable scripts, as user visible names or ids change across workspaces or across tenants. Please be mindful that although you can edit Custom IDs, each State/Transition CustomID must be unique in a given workflow.
- For more info on scripting project- and wf-related functions, please see Scripting Reference section in our online Help.
- For info on WF Editor and exposing/setting customIDs for states and transitions, please see Workflow Editor UI topic.
Hope this helps,
Martin Gasevski | Fusion 360 Team Product Manager