Content
You are here:
Set status of existing ticket via API
Added by Jonah Sundahl almost 5 years ago
Hi, I'm trying to figure out how to set the status of an existing ticket via the API. I'm using the PATCH /api/v3/work_packages/<wp number>
endpoint, which I can get a 200 from (and edit fields like the title), it just doesn't update the status at all. So far the bodies I have tried are as follows:
Any help is appreciated, thanks!
Note: "-----" delimits different bodies, and they all are passed
with "lockVersion" and complete with status code 200
------
"_embedded": {
"status": {
"id": 7,
"name": "Implementation",
"isClosed": false,
"color": "#66D9E8",
"isDefault": false,
"isReadonly": false,
"defaultDoneRatio": null,
"position": 4
}
}
------
"_links": {
"status": {
"href": "/api/v3/statuses/7",
"Title": "Implementation"
}
}
-------
both of the above combined into one body as siblings, and just the "status" child of "_embedded"
------
"status": "Implementation"
------
"status": 7
------
"status": { "id": 7 }
Replies (2)
Hi Jona,
To change only the status to the one with ID 7, execute the patch with the following body:
The lockVersion value must correspond to the value you got from the API request. It's an optimistic locking approach to ensure you are the working on the last state of the work package.
Best
Oliver
that worked, thanks oliver!