. Control Task Progression To ensure that a change task moves from “Open” to “Work in…
- User
. Control Task Progression To ensure that a change task moves from “Open” to “Work in Progress” only after the preceding task is closed, consider following a two-step approach using scripting:
- UI Action: For Manual Status Change
- Create a UI Action on the Change Task table for users to manually initiate the status change.
- Name: Begin Work
- Table: Change Task (change_task)
- Action name: begin_work
- Script:
if (gs.hasRole('change_manager')) { // Check if user has appropriate role var gr = new GlideRecord('change_task'); gr.addQuery('change_request', current.change_request); gr.addQuery('order', '<', current.order); gr.addQuery('state', '!=', 'Closed'); // Assuming ‘Closed’ is the state to check, adjust based on your instance gr.query(); if (!gr.hasNext()) { current.state = 'Work in Progress'; // Adjust the field and value based on your requirements current.update(); action.setRedirectURL(current); } else { gs.addErrorMessage('Previous tasks must be completed before starting this task.'); } } else { gs.addErrorMessage('You do not have permissions to perform this action.'); }
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.