Update Project State
Instructions
Parse arguments
- Extract from
$ARGUMENTS:project_id— the project identifierfield— the state field to updatevalue— the new value to setreason— why this change is being made
- If any required parameter is missing, ask the user to provide it.
- Extract from
Check current state
- Call
get_statewith theproject_idto read the current value of the field. - Log the current value for reference before making changes.
- Call
Attempt to set state
- Call
set_statewithproject_id,field,value, andreason. - If the call succeeds, proceed to verification.
- Call
Handle approval flow (if needed)
- If
set_statefails due to ownership or permission restrictions:- Call
request_approvalto submit the state change for approval. - Notify the state owner via
send_dmthat an approval is pending. - Report to the user that the change requires approval and is pending.
- Stop here — do not retry.
- Call
- If
Verify the update
- Call
get_stateagain with the sameproject_idand confirm the field now holds the new value. - Report success with both the old and new values.
- Call
Notify if appropriate
- If the state change is significant (e.g., status transitions like "in-progress" to "done"), send a notification to the relevant channel via
send_message.
- If the state change is significant (e.g., status transitions like "in-progress" to "done"), send a notification to the relevant channel via
$ARGUMENTS
/update-state <project_id> <field> <value> <reason>- Example:
/update-state proj-123 status in-review "Feature implementation complete, ready for review"