Create Ticket

Creates a new ticket.

HTTP Request

POST /api/sonar/tickets
Request using cURL
curl -H "Authorization: Bearer <API_KEY>" \
     -d repo_guid=5f0ba741-7551-400d-8bd6-1f14a6e8536d \
     -d guid=638cfeb2-e259-46af-961a-1eeb65ea35f0 \
     -d priority=LOW \
     -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 14:55:54+0900"",""priority"":""LOW"",""src_ip"":""3.83.23.230"",""dst_ip"":""13.125.82.152"",""dst_port"":443}" \
     -X POST \
     https://HOSTNAME/api/sonar/tickets
Request Parameters
KeyRequiredTypeDescriptionNote
repo_guidOStringTicket repository GUID36 characters
guidOStringTicket GUID36 characters
priorityOStringPriorityLOW or MEDIUM or HIGH
titleOStringTitleMinimum 1 to maximum 255 characters
formatOStringContent formatJSON or MARKDOWN or PLAIN
contentOStringContentMinimum 1 to maximum 100,000 characters
assigneesXList (of strings)Assignee GUID listComma-separated list
approversXList (of strings)Approver GUID listComma-separated list
attachmentsXList (of strings)Attachment GUID listComma-separated list
Note
Attachments refer to file objects that have already been uploaded, so they can exist before the ticket is created. Unreferenced ticket file objects are automatically destroyed at midnight each day.

Success Response

{}

Error Responses

Required argument is missing

HTTP status code 400

{
    "error_code": "null-argument",
    "error_msg": "repo_guid 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 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 the content is not in JSON format.

{
    "error_code": "invalid-argument",
    "error_msg": "content should be JSON format - Expected a ',' or '}' at character 146"
}
List of assignees or approvers has non-GUID value

HTTP status code 400

{
    "error_code": "invalid-param-type",
    "error_msg": "assignees should be guid type."
}
Duplicate ticket GUID is found

HTTP status code 500

{
    "error_code": "illegal-state",
    "error_msg": "duplicated ticket guid: 638cfeb2-e259-46af-961a-1eeb65ea35f0"
}
Assignee or approver is not found

HTTP status code 500

{
    "error_code": "illegal-state",
    "error_msg": "assignee not found: fae7fa2b-756e-4d3d-b314-e631daf70c7a"
}
Attachment is not found

HTTP status code 500

{
    "error_code": "illegal-state",
    "error_msg": "attachment not found: 8e904789-b9b9-443a-b1a1-86a36119c74c"
}