티켓 생성

새 티켓을 생성합니다.

필요 권한

사용자 이상의 계정으로 이용할 수 있습니다.

HTTP 요청

POST /api/sonar/tickets
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="웹 서버 설정 수집 시도" \
     -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
요청 매개변수
필수타입설명비고
repo_guidO문자열티켓 분류 GUID36자
guidO문자열티켓 GUID36자
priorityO문자열중요도LOW, MEDIUM, HIGH 중 하나.
titleO문자열제목최소 1자, 최대 255자
formatO문자열내용 형식JSON, MARKDOWN, PLAIN 중 하나.
contentO문자열내용최소 1자, 최대 100000자
assigneesX문자열 목록담당자 GUID 목록여러 개의 GUID는 쉼표(,)로 구분
approversX문자열 목록결재자 GUID 목록여러 개의 GUID는 쉼표(,)로 구분
attachmentsX문자열 목록첨부파일 GUID 목록여러 개의 GUID는 쉼표(,)로 구분
Note
첨부파일은 이미 업로드 된 파일 객체를 참조하므로 티켓이 생성되기 전에 존재할 수 있습니다. 참조되지 않는 티켓 파일 객체는 매일 자정에 자동으로 파기됩니다.

정상 응답

{}

오류 응답

필수 매개변수가 누락된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "null-argument",
  "error_msg": "repo_guid should be not null"
}
매개변수 값의 길이가 잘못된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "'title' must be shorter than or equal to 255 characters."
}
유효하지 않은 중요도를 지정한 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "priority should be one of 'LOW', 'MEDIUM', 'HIGH'."
}
유효하지 않은 형식을 지정한 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "format should be one of 'JSON', 'MARKDOWN', 'PLAIN'."
}
내용이 JSON 형식이 아닌 경우

내용 형식(format)을 JSON으로 지정한 경우, 내용(content)이 JSON 형식이 아니면 오류가 발생합니다.

{
  "error_code": "invalid-argument",
  "error_msg": "content should be JSON format - Expected a ',' or '}' at character 146"
}
담당자, 결재자 목록이 GUID 형식이 아닌 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-param-type",
  "error_msg": "assignees should be guid type."
}
티켓 GUID가 중복된 경우

HTTP 상태 코드 500 응답

{
  "error_code": "illegal-state",
  "error_msg": "duplicated ticket guid: 638cfeb2-e259-46af-961a-1eeb65ea35f0"
}
담당자, 결재자가 존재하지 않는 경우

HTTP 상태 코드 500 응답

{
  "error_code": "illegal-state",
  "error_msg": "assignee not found: fae7fa2b-756e-4d3d-b314-e631daf70c7a"
}
첨부 파일이 존재하지 않는 경우

HTTP 상태 코드 500 응답

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