UpdateWorkitem - Update a workitem
Updates a workitem by specifying fields in the request body as a JSON object. Use the format {"fieldId":"value"} for single-value fields and {"fieldId":["value1", "value2"]} for multi-value fields. For example, to change the subject, use {"subject":"test-update-by-api"}. To change the description and its format, use {"description": "## This is a Markdown description", "formatType": "MARKDOWN"}. The formatType can be RICHTEXT (rich text, default) or MARKDOWN. To change the status, use {"status":"statusId"}. To change the assignee, use {"assignedTo":"userId"}. To change the priority, use {"priority":"priorityId"}. Call the GetWorkitemTypeFieldConfiguration API to obtain available values for fieldId. To specify the operator, add the "operatorId":"userId" parameter. This parameter is ignored when you use a personal access token.
|
Applicable editions |
Central edition, Region edition |
Endpoints and authorization
-
Obtain the endpoint. Replace
{domain}in the request syntax with the endpoint. -
Obtain a personal access token.
-
Obtain the organization ID. Required only for the Central edition. You can find your organization ID on the Basic Information page in the organization management console.
|
Product |
Resource |
Permissions |
|
Projex |
workitem |
Read and write |
Request syntax
Central edition
PUT https://{domain}/oapi/v1/projex/organizations/{organizationId}/workitems/{id}
Region edition
PUT https://{domain}/oapi/v1/projex/workitems/{id}
Request headers
|
Parameter |
Type |
Required |
Description |
Example |
|
x-yunxiao-token |
string |
Yes |
Your personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Location |
Required |
Description |
Example |
|
id |
string |
path |
Yes |
The workitem ID. |
|
|
organizationId |
string |
path |
|
The organization ID. |
|
|
- |
object |
body |
No |
The fields to update. |
Request examples
Central edition
curl -X 'PUT' \
'https://{domain}/oapi/v1/projex/organizations/{organizationId}/workitems/{id}' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"subject": "New subject from API"
}'
Region edition
curl -X 'PUT' \
'https://{domain}/oapi/v1/projex/workitems/{id}' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"subject": "New subject from API"
}'
Response parameters
This operation does not return any data in the response body.
Error codes
For common API error codes, see the Error Center.