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
Path Parameters
KeyTypeDescriptionNote
guidStringTicket GUID36 characters
Request Body Parameters
KeyRequiredTypeDescriptionNote
priorityYesStringPriorityLOW or MEDIUM or HIGH
titleYesStringTitleMinimum 1 to maximum 255 characters
formatYesStringContent formatJSON or MARKDOWN or PLAIN
contentYesStringContentMinimum 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 format is specified

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "format should be one of 'JSON', 'MARKDOWN', 'PLAIN'."
}
Invalid Priority value

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "priority should be one of 'LOW', 'MEDIUM', 'HIGH'."
}
Content is not in JSON format

An error occurs when the format is JSON but the content is not valid JSON.

HTTP status code 400

{
  "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-1eeb65ea35f0"
}
Update a ticket generated by system

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "cannot update system ticket: 638cfeb2-e259-46af-961a-1eeb65ea35f0"
}
Permission denied

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}