---
# System prepended metadata

title: 이슈 관리

---

# 이슈 관리

### 열린 이슈 조회
```
GET /api/issues?status=open
```
- request header
```
Authorization: Bearer {token}
```

- request query parameter
```
status=open
```

- response
```json
{
  "count":{
    "label": 3,
    "milestone": 2,
    "openedIssue": 2,
    "closedIssue": 0,
  },
  "issues": [
    {
      "id":1,
      "title": "구조 만들기"  (string),
      "author": "eNoLJ",
      "createdDate": "2021-05-21 15:00" (number),
      "commentNumber": 3,
      "assignees": [img, img],
      "labels": ["bug", "documentation"],
      "milestone": "마스터즈 코스"
    }
  ]
}
```

---

### 닫힌 이슈 조회
```
GET /api/issues?status=close
```
- request header
```
Authorization: Bearer {token}
```

- request query parameter
```
status=close
```

- response
```json
{
  "count":{
    "label": 3,
    "milestone": 2,
    "openedIssue": 2,
    "closedIssue": 0,
  },
  "issues": [
    {
      "id":1,
      "title": "구조 만들기"  (string),
      "author": "eNoLJ",
      "createdDate": "2021-05-21 15:00" (number),
      "commentNumber": 3,
      "assignees": [img, img],
      "labels": ["bug", "documentation"],
      "milestone": "마스터즈 코스"
    }
  ]
}
```

---

### 이슈 닫기 & 열기
```
PATCH /api/issues
```
- request header
```
Authorization: Bearer {token}
```
- request body
{
  "issueNumbers": [1, 2, 3] 
}
- response
200


### 이슈 생성 페이지 요청
```
GET /api/issues/form
```
- request header
```
Authorization: Bearer {token}
```
- response

```json
{
  "assignees": [
   {
      "id": 1,
      "image": "saksksks",
      "userName": "eNoLJ"
    },
    {
      "id": 2,
      "image": "saksksks",
      "userName": "jane"
    },
  ]
  "labels": [
   {
     "id": 1,
     "name": "document",
     "colorCode": "#FFADD2",
     "description": "new document",
    },
   {
     "id": 2,
     "name": "enhancement",
     "colorCode": "#FFADD2",
     "description": "new feature",
    }
  ],
  "milestone": [
    {
     "id": 1,
     "title": "마일스톤 제목",
     "description": "레이블에 대한 설명",
     "createdDate": "2021-05-15 15:55:20",
     "openedIssues:": 3,
     "closedIssues:": 1
    },
    {
     "id": 2,
     "title": "마일스톤 제목",
     "description": "레이블에 대한 설명",
     "createdDate": "2021-05-15 15:55:20",
     "openedIssues:": 3,
     "closedIssues:": 1
    }
  ],
}
```

---

### 이슈 생성
```
GET /api/issues/form
```
- request header
```
Authorization: Bearer {token}
```
- request body

```json
{
  "title": "이슈 제목",
  "comment": "이슈 내용",
  "assignees": [1, 2]
  "labels": [1, 2, 3],
  "milestone": 1,
}
```
- response
200

---

### 이슈 상세 페이지
```
GET /api/issues/{issueId}
```
- request header
```
Authorization: Bearer {token}
```
- response
```json
{
  "id": 1
  "title": "FE 이슈트래커 디자인 구현",
  "status": true,
  "createdDate": "2021-06-06 10:10:10",
  "comments": [
    {
      "id": 1,
      "userName": "janeljs",
      "comment": "안녕하세요. 주나미 최고", 
      "createdDate": "2021-06-06 10:10:10",
      "isOwner": true,
      "isAuthor": false,
    },
    {
      "id": 2,
      "userName": "janeljs",
      "comment": "안녕하세요.", 
      "createdDate": "2021-06-06 10:10:10",
      "isOwner": true,
      "isAuthor": false,
    }
  ],
  "assignees": [
   {
      "id": 1,
      "image": "saksksks",
      "userName": "eNoLJ"
    },
    {
      "id": 2,
      "image": "saksksks",
      "userName": "jane"
    },
  ]
  "labels": [
   {
     "id": 1,
     "name": "document",
     "colorCode": "#FFADD2",
     "description": "new document",
    },
   {
     "id": 2,
     "name": "enhancement",
     "colorCode": "#FFADD2",
     "description": "new feature",
    }
  ],
  "milestone": {
    "id": 1,
    "title": "마일스톤 제목",
    "description": "레이블에 대한 설명",
    "createdDate": "2021-05-15 15:55:20",
    "openedIssues:": 3,
    "closedIssues:": 1
  }
}
```

---

### 이슈 제목 편집
```
PATCH /api/issues/{issueId}/title
```
- request header
```
Authorization: Bearer {token}
```
- request body
```json
{
  "title": "[BE] 컨트롤러 메서드 구현",
}
```
- response
200

---

### 담당자 가져오기
```
GET /api/issues/{issueId}/assignees
```
- request header
```
Authorization: Bearer {token}
```
- response
```json
{
  "assignees": [ // 다 보내줌
   {
      "id": 1,
      "image": "saksksks",
      "userName": "eNoLJ",
      "isChecked": "true"
    },
    {
      "id": 2,
      "image": "saksksks",
      "userName": "jane",
      "isChecked": "false"
    },
  ]
}
```

---

### 이슈 안에 담당자 편집
```
PATCH /api/issues/{issueId}/assignees
```
- request header
```
Authorization: Bearer {token}
```
- response body
```json
{
  "assignees": [
    {
      "id": 1,
      isAssigned: true
    },
    {
      "id": 2,
      isAssigned: true
    },
    {
      "id": 3,
      isAssigned: false
    }
  ],
}

```

---


### 이슈의 레이블 가져오기
```
GET /api/issues/{issueId}/labels
```

- request
```
Authorization: Bearer {token}
```

- response
```json
{
  "labels": [
   {
     "id": 1,
     "name": "document",
     "colorCode": #FFADD2,
     "description": "도큐먼트",
     "isChecked": true
    },
    {
     "id": 2,
     "name": "feature",
     "colorCode": #FFADD2,
     "description": "피쳐",
     "isChecked": false
    },
  ]
}
```

---

### 이슈의 레이블 편집 

```
POST /api/issues/{issueId}/labels
```
- request header
```
Authorization: Bearer {token}
```
- request body
```json
{
  "label" : {
    "id": 1,
    "isChecked": true
  }
}
```

- response
200

---

### 이슈의 마일스톤 가져오기
```
GET /api/issues/{issueId}/milestones
```

- request
```
Authorization: Bearer {token}
```

- response
```json
{
  "milestones": [
   {
      "id": 1,
      "name": “be”,
      "createdDate": "2021-05-15 15:55:20",
      "progress": 80
    },
  ]
}
```

---

### 이슈의 마일스톤 편집 

```
POST /api/issues/{issueId}/milestones
```
- request header
```
Authorization: Bearer {token}
```
- request body
```json
{
  "milestones" : {
    "id": 1
  }
}
```
- response
200

---

### 코멘트 작성

```
POST /api/issues/{issueId}/comment
```
- request header
```
Authorization: Bearer {token}
```
- request body
```json
{
  "comment": "마감일은 언제인가요?"
}
```
- response
200

---

### 코멘트 편집
```
PATCH /api/issues/{issueId}/comments/{commentId}
```
- request header
```
Authorization: Bearer {token}
```
- request body
 ```json
{
  "comment": "마감일은 언제인가요?"
}
```

- response
200

---

### 코멘트 삭제
```
DELETE /api/issues/{issueId}/comments/{commentId}
```
- request header
```
Authorization: Bearer {token}
```

- response
200

---

### 전체 라벨 조회
```
GET /api/labels
```
- request header
```
Authorization: Bearer {token}
```
- response

```json
{
  "labelsCount": 3,
  "milestonesCount": 2,
  "labels": [
   {
     "id": 1,
     "name": "document",
     "colorCode": "#FFADD2",
     "description": "new document",
    },
   {
     "id": 2,
     "name": "enhancement",
     "colorCode": "#FFADD2",
     "description": "new feature",
    }
  ]
}
```

---

### 라벨 추가
```
POST /api/labels
```
- request header
```
Authorization: Bearer {token}
```
- request body
```json
{
  "title": "feature",
  "description": "기능에 대한 레이블입니다.",
  "색상": "#96F879"
}
```
- response
200

---

### 라벨 편집
```
PATCH /api/labels/{labelId}
```

- request header
```
Authorization: Bearer {token}
```

- request body
```json
{
  "title": "feature",
  "description": "기능에 대한 레이블입니다.",
  "색상": "#96F879"
}
```

- response
200

---

### 라벨 삭제
```
DELETE /api/labels/{labelId}
```
- request header
```
Authorization: Bearer {token}
```

- response
200

---

### 전체 마일스톤 조회
```
GET /api/milestones
```
- request header
```
Authorization: Bearer {token}
```
- response

```json
{
  "labelsCount": 3,
  "milestonesCount": 2,
  "milestones": [
   {
     "id": 1,
     "title": "마일스톤 제목",
     "description": "레이블에 대한 설명",
     "createdDate": "2021-05-15 15:55:20",
     "openedIssues:": 3,
     "closedIssues:": 1
    },
   {
     "id": 2,
     "title": "마스터즈 코스",
     "description": "코드스쿼드 마스터즈 코스",
     "createdDate": "2021-05-15 15:55:20",
     "dueDate": "2021-05-15",
     "openedIssues:": 3,
     "closedIssues:": 1
    }
  ]
}
```

---

### 마일스톤 추가
```
POST /api/milestones
```
- request header
```
Authorization: Bearer {token}
```
- request body
```json
{
  "title": "마일스톤 제목",
  "dueDate": "2022-05-18", (optional)
  "description": "마일스톤 기능 목록",
}
```
- response
200

---

### 마일스톤 편집
```
PATCH /api/milestones/{milestoneId}
```

- request header
```
Authorization: Bearer {token}
```

- request body
```json
{
  "title": "마일스톤 제목",
  "dueDate": "2022-05-18", (optional)
  "description": "마일스톤 기능 목록",
}
```

- response
200

---

### 마일스톤 삭제
```
DELETE /api/milestones/{milestoneId}
```
- request header
```
Authorization: Bearer {token}
```

- response
200