Update Ticket
Updates a specified ticket.
Required Permissions
Requires the MEMBER role or higher.
HTTP Request
PUT /api/sonar/tickets/:guid
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-d priority=HIGH \
-d title="Attempt to collect web server settings" \
-d format=JSON \
--data-urlencode content="{""first_seen"":""2022-09-20 14:55:54+0900"",""last_seen"":""2022-09-20 19:44:24+0900"",""priority"":""HIGH"",""src_ip"":""3.83.23.230"",""dst_ip"":""13.125.82.152"",""dst_port"":443}" \
-X PUT \
https://HOSTNAME/api/sonar/tickets/638cfeb2-e259-46af-961a-1eeb65ea35f0
Request Parameters
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| guid | O | String | Ticket GUID | 36 characters |
| priority | O | String | Priority | LOW or MEDIUM or HIGH |
| title | O | String | Title | Minimum 1 to maximum 255 characters |
| format | O | String | Content format | JSON or MARKDOWN or PLAIN |
| content | O | String | Content | Minimum 1 to maximum 100,000 characters |
Success Response
{}
Error Responses
Required argument is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "title should be not null"
}
Invalid argument length
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'title' must be shorter than or equal to 255 characters."
}
Invalid Priority value
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "priority should be one of 'LOW', 'MEDIUM', 'HIGH'."
}
Invalid format is specified
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "format should be one of 'JSON', 'MARKDOWN', 'PLAIN'."
}
Content is not in JSON format
When the content format (format) is specified as JSON, an error occurs if content (content) is not in JSON format.
{
"error_code": "invalid-argument",
"error_msg": "content should be JSON format - Expected a ',' or '}' at character 146"
}
Ticket is not found
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "ticket not found: 638cfeb2-e259-46af-961a-1eeb65ea35f1"
}
Update a ticket generated by system
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "cannot update system ticket: 638cfeb2-e259-46af-961a-1eeb65ea35f1"
}