update_work
Modify existing work items in DevRev by updating fields like title, status, assignees, or sprint assignments to track progress changes.
Instructions
Update an existing work item (issue, ticket) in DevRev
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | ||
| id | Yes | ||
| title | No | ||
| body | No | ||
| applies_to_part | No | The DevRev ID of the part to which the work item applies | |
| 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 | |
| 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. | |
| sprint | No | The DevRev ID of the sprint to be assigned to an issue. | |
| subtype | No |
Implementation Reference
- src/devrev_mcp/server.py:645-715 (handler)Handler for the 'update_work' tool: parses arguments into payload and calls DevRev API 'works.update' via make_devrev_request.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 handle_list_tools(), including name, description, and input schema definition.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/utils.py:12-39 (helper)Helper utility function used by the handler to send authenticated POST requests to DevRev API endpoints.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 )