update_work
Modify work items such as issues or tickets in DevRev by updating fields like title, description, assigned users, stage, or sprint using the MCP server.
Instructions
Update an existing work item (issue, ticket) in DevRev
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| applies_to_part | No | The DevRev ID of the part to which the work item applies | |
| body | No | ||
| id | Yes | ||
| modified_by | No | The DevRev IDs of the users who modified the work item | |
| owned_by | No | The DevRev IDs of the users who are assigned to the work item | |
| sprint | No | The DevRev ID of the sprint to be assigned to an issue. | |
| stage | No | The stage name of the work item. Use valid_stage_transition tool to get the list of valid stages you an update to. | |
| subtype | No | ||
| title | No | ||
| type | Yes |
Implementation Reference
- src/devrev_mcp/server.py:645-715 (handler)Handler logic for the 'update_work' tool: parses arguments, builds payload for DevRev API, calls make_devrev_request with 'works.update' endpoint, and returns success or error message.elif name == "update_work": if not arguments: raise ValueError("Missing arguments") payload = {} id = arguments.get("id") if not id: raise ValueError("Missing id parameter") payload["id"] = id type = arguments.get("type") if not type: raise ValueError("Missing type parameter") payload["type"] = type title = arguments.get("title") if title: payload["title"] = title body = arguments.get("body", "") if body: payload["body"] = body modified_by = arguments.get("modified_by") if modified_by: payload["modified_by"] = modified_by owned_by = arguments.get("owned_by") if owned_by: payload["owned_by"] = owned_by applies_to_part = arguments.get("applies_to_part", []) if applies_to_part: payload["applies_to_part"] = applies_to_part stage = arguments.get("stage") if stage: payload["stage"] = {"name": stage} sprint = arguments.get("sprint") if sprint: payload["sprint"] = sprint subtype = arguments.get("subtype") if subtype: if subtype["drop"]: payload["custom_schema_spec"] = {"drop": {"subtype": True}, "tenant_fragment": True, "validate_required_fields": True} else: payload["custom_schema_spec"] = {"subtype": subtype["subtype"], "tenant_fragment": True, "validate_required_fields": True} response = make_devrev_request( "works.update", payload ) if response.status_code != 200: error_text = response.text return [ types.TextContent( type="text", text=f"Update object failed with status {response.status_code}: {error_text}" ) ] return [ types.TextContent( type="text", text=f"Object updated successfully: {id}" ) ]
- src/devrev_mcp/server.py:89-115 (registration)Registration of the 'update_work' tool in list_tools(), including name, description, and detailed inputSchema for parameters like id, type, title, stage, etc.types.Tool( name="update_work", description="Update an existing work item (issue, ticket) in DevRev", inputSchema={ "type": "object", "properties": { "type": {"type": "string", "enum": ["issue", "ticket"]}, "id": {"type": "string"}, "title": {"type": "string"}, "body": {"type": "string"}, "applies_to_part": {"type": "string", "description": "The DevRev ID of the part to which the work item applies"}, "modified_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who modified the work item"}, "owned_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who are assigned to the work item"}, "stage": {"type": "string", "description": "The stage name of the work item. Use valid_stage_transition tool to get the list of valid stages you an update to."}, "sprint": {"type": "string", "description": "The DevRev ID of the sprint to be assigned to an issue."}, "subtype": { "type": "object", "properties": { "drop": {"type": "boolean", "description": "If true, the subtype will be dropped from the work item. If false, the subtype will be added to the work item."}, "subtype": {"type": "string", "description": "The subtype value of the work item. Remember to use list_subtypes tool to get the list of valid subtypes."} }, "required": ["drop"] } }, "required": ["id", "type"], }, ),
- src/devrev_mcp/server.py:92-113 (schema)JSON Schema definition for input parameters of update_work tool.inputSchema={ "type": "object", "properties": { "type": {"type": "string", "enum": ["issue", "ticket"]}, "id": {"type": "string"}, "title": {"type": "string"}, "body": {"type": "string"}, "applies_to_part": {"type": "string", "description": "The DevRev ID of the part to which the work item applies"}, "modified_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who modified the work item"}, "owned_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who are assigned to the work item"}, "stage": {"type": "string", "description": "The stage name of the work item. Use valid_stage_transition tool to get the list of valid stages you an update to."}, "sprint": {"type": "string", "description": "The DevRev ID of the sprint to be assigned to an issue."}, "subtype": { "type": "object", "properties": { "drop": {"type": "boolean", "description": "If true, the subtype will be dropped from the work item. If false, the subtype will be added to the work item."}, "subtype": {"type": "string", "description": "The subtype value of the work item. Remember to use list_subtypes tool to get the list of valid subtypes."} }, "required": ["drop"] } }, "required": ["id", "type"],
- src/devrev_mcp/utils.py:12-39 (helper)Utility function make_devrev_request used by the update_work handler to perform the actual API call to 'works.update' endpoint.def make_devrev_request(endpoint: str, payload: Dict[str, Any]) -> requests.Response: """ Make an authenticated request to the DevRev API. Args: endpoint: The API endpoint path (e.g., "works.get" or "search.hybrid") payload: The JSON payload to send Returns: requests.Response object Raises: ValueError: If DEVREV_API_KEY environment variable is not set """ api_key = os.environ.get("DEVREV_API_KEY") if not api_key: raise ValueError("DEVREV_API_KEY environment variable is not set") headers = { "Authorization": f"{api_key}", "Content-Type": "application/json", } return requests.post( f"https://api.devrev.ai/{endpoint}", headers=headers, json=payload )