<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Issues API > 原文:[https://docs.gitlab.com/ee/api/issues.html](https://docs.gitlab.com/ee/api/issues.html) * [Issues pagination](#issues-pagination) * [List issues](#list-issues) * [List group issues](#list-group-issues) * [List project issues](#list-project-issues) * [Single issue](#single-issue) * [New issue](#new-issue) * [Rate limits](#rate-limits) * [Edit issue](#edit-issue) * [Delete an issue](#delete-an-issue) * [Reorder an issue](#reorder-an-issue) * [Move an issue](#move-an-issue) * [Subscribe to an issue](#subscribe-to-an-issue) * [Unsubscribe from an issue](#unsubscribe-from-an-issue) * [Create a todo](#create-a-todo) * [Set a time estimate for an issue](#set-a-time-estimate-for-an-issue) * [Reset the time estimate for an issue](#reset-the-time-estimate-for-an-issue) * [Add spent time for an issue](#add-spent-time-for-an-issue) * [Reset spent time for an issue](#reset-spent-time-for-an-issue) * [Get time tracking stats](#get-time-tracking-stats) * [List merge requests related to issue](#list-merge-requests-related-to-issue) * [List merge requests that will close issue on merge](#list-merge-requests-that-will-close-issue-on-merge) * [Participants on issues](#participants-on-issues) * [Comments on issues](#comments-on-issues) * [Get user agent details](#get-user-agent-details) # Issues API[](#issues-api "Permalink") 如果用戶不是項目成員,并且該項目是私有項目,則對該項目的`GET`請求將產生`404`狀態代碼. ## Issues pagination[](#issues-pagination "Permalink") 默認情況下,因為 API 結果是分頁的,所以`GET`請求一次返回 20 個結果. 閱讀有關[分頁的](README.html#pagination)更多信息. **棄用:不建議使用**響應中的`reference`屬性,而推薦使用`references` . >推出了[GitLab 12.6](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/20354)**注意:** > `references.relative`相對于正在請求問題的組/項目. 從其項目中獲取問題時> `relative`格式將與`short`格式相同,并且在跨組/項目進行請求時, `relative`格式將與`full`格式相同. ## List issues[](#list-issues "Permalink") 獲取經過身份驗證的用戶有權訪問的所有問題. 默認情況下,它僅返回當前用戶創建的問題. 要獲取所有問題,請使用參數`scope=all` . ``` GET /issues GET /issues?state=opened GET /issues?state=closed GET /issues?labels=foo GET /issues?labels=foo,bar GET /issues?labels=foo,bar&state=opened GET /issues?milestone=1.0.0 GET /issues?milestone=1.0.0&state=opened GET /issues?iids[]=42&iids[]=43 GET /issues?author_id=5 GET /issues?assignee_id=5 GET /issues?my_reaction_emoji=star GET /issues?search=foo&in=title GET /issues?confidential=true ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `state` | string | no | 返回`all`問題,或者僅返回已`opened`或`closed` | | `labels` | string | no | Comma-separated list of label names, issues must have all labels to be returned. `None` lists all issues with no labels. `Any` lists all issues with at least one label. `No+Label` (Deprecated) lists all issues with no labels. Predefined names are case-insensitive. | | `with_labels_details` | boolean | no | 如果為`true` ,則響應將為標簽字段中的每個標簽返回更多詳細信息`:name` , `:color` , `:description` , `:description_html` , `:text_color` . 默認值為`false` . [GitLab 12.7](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21413)中引入了`description_html`屬性 | | `milestone` | string | no | 里程碑標題. `None`列出沒有里程碑的所有問題. `Any`列出具有指定里程碑的所有問題. | | `scope` | string | no | 回到問題在給定范圍: `created_by_me` , `assigned_to_me`或`all` . 默認為`created_by_me` 對于 11.0 之前的版本,請改用現在不建議使用`created-by-me`范圍或`created-by-me` `assigned-to-me`范圍. *(在 GitLab 9.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) .在 GitLab 11.0 中[更改為 snake_case](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/18935) )* | | `author_id` | integer | no | 返回由給定用戶`id`創建的問題. 與`author_username` . 與`scope=all`或`scope=assigned_to_me`結合使用. *(在 GitLab 9.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) )* | | `author_username` | string | no | 返回由給定`username`創建的問題. 類似于`author_id`并且與`author_id` . | | `assignee_id` | integer | no | 返回分配給給定用戶`id` . 互斥與`assignee_username` . `None`返回未分配的問題. 受讓人有`Any`退貨問題. *(在 GitLab 9.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) )* | | `assignee_username` | 字符串數組 | no | 返回分配給給定`username` . 類似于`assignee_id`并且與`assignee_id`互斥. 在 GitLab CE 中, `assignee_username`數組應僅包含單個值,否則將返回無效的參數錯誤. | | `my_reaction_emoji` | string | no | 返回的問題由已驗證的用戶通過給定的`emoji`響應. `None`返回沒有響應的問題. 至少有一個反應, `Any`回報問題. *(在 GitLab 10.0 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14016) )* | | `weight` | integer | no | 以指定的`weight`返回問題. `None`返回沒有分配權重的問題. 分配了權重的`Any`退貨問題. | | `iids[]` | 整數數組 | no | 僅返回具有給定`iid`的問題 | | `order_by` | string | no | 回到問題下令`created_at` , `updated_at` , `priority` , `due_date` , `relative_position` , `label_priority` , `milestone_due` , `popularity` , `weight`領域. 默認為`created_at` | | `sort` | string | no | 返回按`asc`或`desc`排列的問題. 默認為`desc` | | `search` | string | no | 根據`title`和`description`搜索問題 | | `in` | string | no | 修改`search`屬性的范圍. `title` , `description`或以逗號將它們連接在一起的字符串. 默認為`title,description` | | `created_after` | datetime | no | 返回在給定時間或之后創建的問題 | | `created_before` | datetime | no | 返回在給定時間或之前創建的問題 | | `updated_after` | datetime | no | 返回在給定時間或之后更新的問題 | | `updated_before` | datetime | no | 返回在給定時間或之前更新的問題 | | `confidential` | boolean | no | 過濾機密或公共問題. | | `not` | Hash | no | 返回與提供的參數不匹配的問題. 接受: `labels` , `milestone` , `author_id` , `author_username` , `assignee_id` , `assignee_username` , `my_reaction_emoji` | | `non_archived` | boolean | no | 僅從未歸檔的項目返回問題. 如果為`false` ,則響應將返回已歸檔和未歸檔項目中的問題. 默認值為`true` . *(在[GitLab 13.0 中](https://gitlab.com/gitlab-org/gitlab/-/issues/197170)引入)* | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/issues" ``` 響應示例: ``` [ { "state" : "opened", "description" : "Ratione dolores corrupti mollitia soluta quia.", "author" : { "state" : "active", "id" : 18, "web_url" : "https://gitlab.example.com/eileen.lowe", "name" : "Alexandra Bashirian", "avatar_url" : null, "username" : "eileen.lowe" }, "milestone" : { "project_id" : 1, "description" : "Ducimus nam enim ex consequatur cumque ratione.", "state" : "closed", "due_date" : null, "iid" : 2, "created_at" : "2016-01-04T15:31:39.996Z", "title" : "v4.0", "id" : 17, "updated_at" : "2016-01-04T15:31:39.996Z" }, "project_id" : 1, "assignees" : [{ "state" : "active", "id" : 1, "name" : "Administrator", "web_url" : "https://gitlab.example.com/root", "avatar_url" : null, "username" : "root" }], "assignee" : { "state" : "active", "id" : 1, "name" : "Administrator", "web_url" : "https://gitlab.example.com/root", "avatar_url" : null, "username" : "root" }, "updated_at" : "2016-01-04T15:31:51.081Z", "closed_at" : null, "closed_by" : null, "id" : 76, "title" : "Consequatur vero maxime deserunt laboriosam est voluptas dolorem.", "created_at" : "2016-01-04T15:31:51.081Z", "moved_to_id" : null, "iid" : 6, "labels" : ["foo", "bar"], "upvotes": 4, "downvotes": 0, "merge_requests_count": 0, "user_notes_count": 1, "due_date": "2016-07-22", "web_url": "http://example.com/my-group/my-project/issues/6", "references": { "short": "#6", "relative": "my-group/my-project#6", "full": "my-group/my-project#6" }, "time_stats": { "time_estimate": 0, "total_time_spent": 0, "human_time_estimate": null, "human_total_time_spent": null }, "has_tasks": true, "task_status": "10 of 15 tasks completed", "confidential": false, "discussion_locked": false, "_links":{ "self":"http://example.com/api/v4/projects/1/issues/76", "notes":"`http://example.com/`api/v4/projects/1/issues/76/notes", "award_emoji":"http://example.com/api/v4/projects/1/issues/76/award_emoji", "project":"http://example.com/api/v4/projects/1" }, "task_completion_status":{ "count":0, "completed_count":0 } } ] ``` 使用 GitLab [Starter,Bronze 或更高版本的用戶](https://about.gitlab.com/pricing/)還將看到`weight`參數: ``` [ { "state" : "opened", "description" : "Ratione dolores corrupti mollitia soluta quia.", "weight": null, ... } ] ``` **注意** :不建議使用`assignee`列,現在我們將其顯示為符合 GitLab EE API 的單一大小的數組`assignees` . **注意** : [GitLab 10.6](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042)中[引入了](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042) `closed_by`屬性. 只有在 GitLab 10.6 之后關閉的問題以及關閉問題的用戶帳戶仍然存在時,才會顯示此值. ## List group issues[](#list-group-issues "Permalink") 獲取小組問題的列表. 如果該組是私有的,則需要提供憑據進行授權. 首選的方法是使用[個人訪問令牌](../user/profile/personal_access_tokens.html) . ``` GET /groups/:id/issues GET /groups/:id/issues?state=opened GET /groups/:id/issues?state=closed GET /groups/:id/issues?labels=foo GET /groups/:id/issues?labels=foo,bar GET /groups/:id/issues?labels=foo,bar&state=opened GET /groups/:id/issues?milestone=1.0.0 GET /groups/:id/issues?milestone=1.0.0&state=opened GET /groups/:id/issues?iids[]=42&iids[]=43 GET /groups/:id/issues?search=issue+title+or+description GET /groups/:id/issues?author_id=5 GET /groups/:id/issues?assignee_id=5 GET /groups/:id/issues?my_reaction_emoji=star GET /groups/:id/issues?confidential=true ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 認證用戶擁有[的組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `state` | string | no | 返回所有問題,或者僅返回已`opened`或`closed` | | `labels` | string | no | 標簽名稱的逗號分隔列表,必須具有要返回的所有標簽的問題. `None`列出所有沒有標簽的問題. `Any`列出至少帶有一個標簽的所有問題. `No+Label` (不推薦使用)列出所有問題且不帶標簽. 預定義名稱不區分大小寫. | | `with_labels_details` | boolean | no | 如果為`true` ,則響應將為標簽字段中的每個標簽返回更多詳細信息`:name` , `:color` , `:description` , `:description_html` , `:text_color` . 默認值為`false` . [GitLab 12.7](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21413)中引入了`description_html`屬性 | | `iids[]` | 整數數組 | no | 僅返回具有給定`iid`的問題 | | `milestone` | string | no | 里程碑標題. `None`列出沒有里程碑的所有問題. `Any`列出具有指定里程碑的所有問題. | | `scope` | string | no | 回到問題在給定范圍: `created_by_me` , `assigned_to_me`或`all` . 對于 11.0 之前的版本,請改用現在不建議使用`created-by-me`范圍或`created-by-me` `assigned-to-me`范圍. *(在 GitLab 9.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) .在 GitLab 11.0 中[更改為 snake_case](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/18935) )* | | `author_id` | integer | no | 返回由給定用戶`id`創建的問題. 與`author_username` . 與`scope=all`或`scope=assigned_to_me`結合使用. *(在 GitLab 9.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) )* | | `author_username` | string | no | 返回由給定`username`創建的問題. 類似于`author_id`并且與`author_id` . | | `assignee_id` | integer | no | 返回分配給給定用戶`id` . 互斥與`assignee_username` . `None`返回未分配的問題. 受讓人有`Any`退貨問題. *(在 GitLab 9.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) )* | | `assignee_username` | 字符串數組 | no | 返回分配給給定`username` . 類似于`assignee_id`并且與`assignee_id`互斥. 在 GitLab CE 中, `assignee_username`數組應僅包含單個值,否則將返回無效的參數錯誤. | | `my_reaction_emoji` | string | no | 返回的問題由已驗證的用戶通過給定的`emoji`響應. `None`返回沒有響應的問題. 至少有一個反應, `Any`回報問題. *(在 GitLab 10.0 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14016) )* | | `weight` | integer | no | 以指定的`weight`返回問題. `None`返回沒有分配權重的問題. 分配了權重的`Any`退貨問題. | | `order_by` | string | no | 回到問題下令`created_at` , `updated_at` , `priority` , `due_date` , `relative_position` , `label_priority` , `milestone_due` , `popularity` , `weight`領域. 默認為`created_at` | | `sort` | string | no | 返回按`asc`或`desc`排列的問題. 默認為`desc` | | `search` | string | no | 搜索組問題的`title`和`description` | | `created_after` | datetime | no | 返回在給定時間或之后創建的問題 | | `created_before` | datetime | no | 返回在給定時間或之前創建的問題 | | `updated_after` | datetime | no | 返回在給定時間或之后更新的問題 | | `updated_before` | datetime | no | 返回在給定時間或之前更新的問題 | | `confidential` | boolean | no | 過濾機密或公共問題. | | `not` | Hash | no | 返回與提供的參數不匹配的問題. 接受: `labels` , `milestone` , `author_id` , `author_username` , `assignee_id` , `assignee_username` , `my_reaction_emoji` , `search` , `in` | | `non_archived` | boolean | no | 從未歸檔的項目返回問題. 默認為 true. *(在[GitLab 12.8 中](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23785)引入)* | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/4/issues" ``` 響應示例: ``` [ { "project_id" : 4, "milestone" : { "due_date" : null, "project_id" : 4, "state" : "closed", "description" : "Rerum est voluptatem provident consequuntur molestias similique ipsum dolor.", "iid" : 3, "id" : 11, "title" : "v3.0", "created_at" : "2016-01-04T15:31:39.788Z", "updated_at" : "2016-01-04T15:31:39.788Z" }, "author" : { "state" : "active", "web_url" : "https://gitlab.example.com/root", "avatar_url" : null, "username" : "root", "id" : 1, "name" : "Administrator" }, "description" : "Omnis vero earum sunt corporis dolor et placeat.", "state" : "closed", "iid" : 1, "assignees" : [{ "avatar_url" : null, "web_url" : "https://gitlab.example.com/lennie", "state" : "active", "username" : "lennie", "id" : 9, "name" : "Dr. Luella Kovacek" }], "assignee" : { "avatar_url" : null, "web_url" : "https://gitlab.example.com/lennie", "state" : "active", "username" : "lennie", "id" : 9, "name" : "Dr. Luella Kovacek" }, "labels" : ["foo", "bar"], "upvotes": 4, "downvotes": 0, "merge_requests_count": 0, "id" : 41, "title" : "Ut commodi ullam eos dolores perferendis nihil sunt.", "updated_at" : "2016-01-04T15:31:46.176Z", "created_at" : "2016-01-04T15:31:46.176Z", "closed_at" : null, "closed_by" : null, "user_notes_count": 1, "due_date": null, "web_url": "http://example.com/my-group/my-project/issues/1", "references": { "short": "#1", "relative": "my-project#1", "full": "my-group/my-project#1" }, "time_stats": { "time_estimate": 0, "total_time_spent": 0, "human_time_estimate": null, "human_total_time_spent": null }, "has_tasks": true, "task_status": "10 of 15 tasks completed", "confidential": false, "discussion_locked": false, "_links":{ "self":"http://example.com/api/v4/projects/4/issues/41", "notes":"`http://example.com/`api/v4/projects/4/issues/41/notes", "award_emoji":"http://example.com/api/v4/projects/4/issues/41/award_emoji", "project":"http://example.com/api/v4/projects/4" }, "task_completion_status":{ "count":0, "completed_count":0 } } ] ``` Users on GitLab [Starter, Bronze, or higher](https://about.gitlab.com/pricing/) will also see the `weight` parameter: ``` [ { "project_id" : 4, "description" : "Omnis vero earum sunt corporis dolor et placeat.", "weight": null, ... } ] ``` **注意** :不建議使用`assignee`列,現在我們將其顯示為符合 GitLab EE API 的單一大小的數組`assignees` . **注意** : [GitLab 10.6](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042)中[引入了](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042) `closed_by`屬性. 只有在 GitLab 10.6 之后關閉的問題以及關閉問題的用戶帳戶仍然存在時,才會顯示此值. ## List project issues[](#list-project-issues "Permalink") Get a list of a project’s issues. 如果項目為私人項目,則需要提供憑據進行授權. 首選的方法是使用[個人訪問令牌](../user/profile/personal_access_tokens.html) . ``` GET /projects/:id/issues GET /projects/:id/issues?state=opened GET /projects/:id/issues?state=closed GET /projects/:id/issues?labels=foo GET /projects/:id/issues?labels=foo,bar GET /projects/:id/issues?labels=foo,bar&state=opened GET /projects/:id/issues?milestone=1.0.0 GET /projects/:id/issues?milestone=1.0.0&state=opened GET /projects/:id/issues?iids[]=42&iids[]=43 GET /projects/:id/issues?search=issue+title+or+description GET /projects/:id/issues?author_id=5 GET /projects/:id/issues?assignee_id=5 GET /projects/:id/issues?my_reaction_emoji=star GET /projects/:id/issues?confidential=true ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `iids[]` | 整數數組 | no | 僅返回具有給定`iid`的問題 | | `state` | string | no | 返回所有問題,或者僅返回已`opened`或`closed` | | `labels` | string | no | 標簽名稱的逗號分隔列表,必須具有要返回的所有標簽的問題. `None`列出所有沒有標簽的問題. `Any`列出至少帶有一個標簽的所有問題. `No+Label` (不推薦使用)列出所有問題且不帶標簽. 預定義名稱不區分大小寫. | | `with_labels_details` | boolean | no | 如果為`true` ,則響應將為標簽字段中的每個標簽返回更多詳細信息`:name` , `:color` , `:description` , `:description_html` , `:text_color` . 默認值為`false` . `description_html`在[GitLab 12.7 中](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21413)引入 | | `milestone` | string | no | 里程碑標題. `None`列出沒有里程碑的所有問題. `Any`列出具有指定里程碑的所有問題. | | `scope` | string | no | 回到問題在給定范圍: `created_by_me` , `assigned_to_me`或`all` . 對于 11.0 之前的版本,請改用現在不建議使用`created-by-me`范圍或`created-by-me` `assigned-to-me`范圍. *(在 GitLab 9.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) .在 GitLab 11.0 中[更改為 snake_case](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/18935) )* | | `author_id` | integer | no | 返回由給定用戶`id`創建的問題. 與`author_username` . 與`scope=all`或`scope=assigned_to_me`結合使用. *(在 GitLab 9.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) )* | | `author_username` | string | no | 返回由給定`username`創建的問題. 類似于`author_id`并且與`author_id` . | | `assignee_id` | integer | no | 返回分配給給定用戶`id` . 互斥與`assignee_username` . `None`返回未分配的問題. 受讓人有`Any`退貨問題. *(在 GitLab 9.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) )* | | `assignee_username` | 字符串數組 | no | 返回分配給給定`username` . 類似于`assignee_id`并且與`assignee_id`互斥. 在 GitLab CE 中, `assignee_username`數組應僅包含單個值,否則將返回無效的參數錯誤. | | `my_reaction_emoji` | string | no | 返回的問題由已驗證的用戶通過給定的`emoji`響應. `None`返回沒有響應的問題. 至少有一個反應, `Any`回報問題. *(在 GitLab 10.0 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14016) )* | | `weight` | integer | no | 以指定的`weight`返回問題. `None`返回沒有分配權重的問題. 分配了權重的`Any`退貨問題. | | `order_by` | string | no | 回到問題下令`created_at` , `updated_at` , `priority` , `due_date` , `relative_position` , `label_priority` , `milestone_due` , `popularity` , `weight`領域. 默認為`created_at` | | `sort` | string | no | 返回按`asc`或`desc`排列的問題. 默認為`desc` | | `search` | string | no | 根據`title`和`description`搜索項目問題 | | `created_after` | datetime | no | 返回在給定時間或之后創建的問題 | | `created_before` | datetime | no | 返回在給定時間或之前創建的問題 | | `updated_after` | datetime | no | 返回在給定時間或之后更新的問題 | | `updated_before` | datetime | no | 返回在給定時間或之前更新的問題 | | `confidential` | boolean | no | 過濾機密或公共問題. | | `not` | Hash | no | 返回與提供的參數不匹配的問題. 接受: `labels` , `milestone` , `author_id` , `author_username` , `assignee_id` , `assignee_username` , `my_reaction_emoji` , `search` , `in` | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/4/issues" ``` 響應示例: ``` [ { "project_id" : 4, "milestone" : { "due_date" : null, "project_id" : 4, "state" : "closed", "description" : "Rerum est voluptatem provident consequuntur molestias similique ipsum dolor.", "iid" : 3, "id" : 11, "title" : "v3.0", "created_at" : "2016-01-04T15:31:39.788Z", "updated_at" : "2016-01-04T15:31:39.788Z" }, "author" : { "state" : "active", "web_url" : "https://gitlab.example.com/root", "avatar_url" : null, "username" : "root", "id" : 1, "name" : "Administrator" }, "description" : "Omnis vero earum sunt corporis dolor et placeat.", "state" : "closed", "iid" : 1, "assignees" : [{ "avatar_url" : null, "web_url" : "https://gitlab.example.com/lennie", "state" : "active", "username" : "lennie", "id" : 9, "name" : "Dr. Luella Kovacek" }], "assignee" : { "avatar_url" : null, "web_url" : "https://gitlab.example.com/lennie", "state" : "active", "username" : "lennie", "id" : 9, "name" : "Dr. Luella Kovacek" }, "labels" : ["foo", "bar"], "upvotes": 4, "downvotes": 0, "merge_requests_count": 0, "id" : 41, "title" : "Ut commodi ullam eos dolores perferendis nihil sunt.", "updated_at" : "2016-01-04T15:31:46.176Z", "created_at" : "2016-01-04T15:31:46.176Z", "closed_at" : "2016-01-05T15:31:46.176Z", "closed_by" : { "state" : "active", "web_url" : "https://gitlab.example.com/root", "avatar_url" : null, "username" : "root", "id" : 1, "name" : "Administrator" }, "user_notes_count": 1, "due_date": "2016-07-22", "web_url": "http://example.com/my-group/my-project/issues/1", "references": { "short": "#1", "relative": "#1", "full": "my-group/my-project#1" }, "time_stats": { "time_estimate": 0, "total_time_spent": 0, "human_time_estimate": null, "human_total_time_spent": null }, "has_tasks": true, "task_status": "10 of 15 tasks completed", "confidential": false, "discussion_locked": false, "_links":{ "self":"http://example.com/api/v4/projects/4/issues/41", "notes":"`http://example.com/`api/v4/projects/4/issues/41/notes", "award_emoji":"http://example.com/api/v4/projects/4/issues/41/award_emoji", "project":"http://example.com/api/v4/projects/4" }, "task_completion_status":{ "count":0, "completed_count":0 } } ] ``` 使用 GitLab [Starter,Bronze 或更高版本的用戶](https://about.gitlab.com/pricing/)還將看到`weight`參數: ``` [ { "project_id" : 4, "description" : "Omnis vero earum sunt corporis dolor et placeat.", "weight": null, ... } ] ``` **注意** :不建議使用`assignee`列,現在我們將其顯示為符合 GitLab EE API 的單一大小的數組`assignees` . **注意** : [GitLab 10.6](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042)中[引入了](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042) `closed_by`屬性. 只有在 GitLab 10.6 之后關閉的問題以及關閉問題的用戶帳戶仍然存在時,才會顯示此值. ## Single issue[](#single-issue "Permalink") 獲得單個項目問題. 如果項目為私人項目或問題為機密,則需要提供憑據進行授權. 首選的方法是使用[個人訪問令牌](../user/profile/personal_access_tokens.html) . ``` GET /projects/:id/issues/:issue_iid ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | The internal ID of a project’s issue | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/4/issues/41" ``` 響應示例: ``` { "project_id" : 4, "milestone" : { "due_date" : null, "project_id" : 4, "state" : "closed", "description" : "Rerum est voluptatem provident consequuntur molestias similique ipsum dolor.", "iid" : 3, "id" : 11, "title" : "v3.0", "created_at" : "2016-01-04T15:31:39.788Z", "updated_at" : "2016-01-04T15:31:39.788Z", "closed_at" : "2016-01-05T15:31:46.176Z" }, "author" : { "state" : "active", "web_url" : "https://gitlab.example.com/root", "avatar_url" : null, "username" : "root", "id" : 1, "name" : "Administrator" }, "description" : "Omnis vero earum sunt corporis dolor et placeat.", "state" : "closed", "iid" : 1, "assignees" : [{ "avatar_url" : null, "web_url" : "https://gitlab.example.com/lennie", "state" : "active", "username" : "lennie", "id" : 9, "name" : "Dr. Luella Kovacek" }], "assignee" : { "avatar_url" : null, "web_url" : "https://gitlab.example.com/lennie", "state" : "active", "username" : "lennie", "id" : 9, "name" : "Dr. Luella Kovacek" }, "labels" : [], "upvotes": 4, "downvotes": 0, "merge_requests_count": 0, "id" : 41, "title" : "Ut commodi ullam eos dolores perferendis nihil sunt.", "updated_at" : "2016-01-04T15:31:46.176Z", "created_at" : "2016-01-04T15:31:46.176Z", "closed_at" : null, "closed_by" : null, "subscribed": false, "user_notes_count": 1, "due_date": null, "web_url": "http://example.com/my-group/my-project/issues/1", "references": { "short": "#1", "relative": "#1", "full": "my-group/my-project#1" }, "time_stats": { "time_estimate": 0, "total_time_spent": 0, "human_time_estimate": null, "human_total_time_spent": null }, "confidential": false, "discussion_locked": false, "_links": { "self": "http://example.com/api/v4/projects/1/issues/2", "notes": "http://example.com/api/v4/projects/1/issues/2/notes", "award_emoji": "http://example.com/api/v4/projects/1/issues/2/award_emoji", "project": "http://example.com/api/v4/projects/1" }, "task_completion_status":{ "count":0, "completed_count":0 } } ``` 使用 GitLab [Starter,Bronze 或更高版本的用戶](https://about.gitlab.com/pricing/)還將看到`weight`參數: ``` { "project_id" : 4, "description" : "Omnis vero earum sunt corporis dolor et placeat.", "weight": null, ... } ``` 使用 GitLab [Premium 的](https://about.gitlab.com/pricing/)用戶還將看到`epic`屬性: ``` { "project_id" : 4, "description" : "Omnis vero earum sunt corporis dolor et placeat.", "epic_iid" : 5, //deprecated, use `iid` of the `epic` attribute "epic": { "id" : 42, "iid" : 5, "title": "My epic epic", "url" : "/groups/h5bp/-/epics/5", "group_id": 8 }, // ... } ``` **注意** :不建議使用`assignee`列,現在我們將其顯示為符合 GitLab EE API 的單一大小的數組`assignees` . **注意** : [GitLab 10.6](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042)中[引入了](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042) `closed_by`屬性. 只有在 GitLab 10.6 之后關閉的問題以及關閉問題的用戶帳戶仍然存在時,才會顯示此值. **注意** : `epic_iid`屬性已過時, [將在版本 5 中刪除](https://gitlab.com/gitlab-org/gitlab/-/issues/35157) . 請改用`epic`屬性的`iid` . ## New issue[](#new-issue "Permalink") 創建一個新的項目問題. ``` POST /projects/:id/issues ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `iid` | integer/string | no | 項目問題的內部 ID(需要管理員或項目所有者權限) | | `title` | string | yes | 問題標題 | | `description` | string | no | 問題的描述. 限制為 1,048,576 個字符. | | `confidential` | boolean | no | 將問題設置為機密. 默認值為`false` . | | `assignee_ids` | 整數數組 | no | 要分配問題的用戶的 ID | | `milestone_id` | integer | no | 分配問題的里程碑的全局 ID | | `labels` | string | no | 問題的逗號分隔標簽名稱 | | `created_at` | string | no | 日期時間字符串,ISO 8601 格式,例如`2016-03-11T03:45:40Z` (需要管理員或項目/組所有者權限) | | `due_date` | string | no | 日期時間字符串,格式為 YEAR-MONTH-DAY,例如`2016-03-11` | | `merge_request_to_resolve_discussions_of` | integer | no | 解決所有問題的合并請求的 IID. 這將使用默認描述填充問題,并將所有討論標記為已解決. 傳遞描述或標題時,這些值將優先于默認值. | | `discussion_to_resolve` | string | no | 要解決的討論的??ID. 這將使用默認描述填充問題,并將討論標記為已解決. 與`merge_request_to_resolve_discussions_of`結合使用. | | `weight` | integer | no | 問題的分量. 有效值大于或等于 0. | | `epic_id` | integer | no | 要添加問題的史詩的 ID. 有效值大于或等于 0. | | `epic_iid` | integer | no | 要添加問題的史詩的 IID. 有效值大于或等于 0.(不建議使用, [將在版本 5 中將其刪除](https://gitlab.com/gitlab-org/gitlab/-/issues/35157) ) | ``` curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/4/issues?title=Issues%20with%20auth&labels=bug" ``` 響應示例: ``` { "project_id" : 4, "id" : 84, "created_at" : "2016-01-07T12:44:33.959Z", "iid" : 14, "title" : "Issues with auth", "state" : "opened", "assignees" : [], "assignee" : null, "labels" : [ "bug" ], "upvotes": 4, "downvotes": 0, "merge_requests_count": 0, "author" : { "name" : "Alexandra Bashirian", "avatar_url" : null, "state" : "active", "web_url" : "https://gitlab.example.com/eileen.lowe", "id" : 18, "username" : "eileen.lowe" }, "description" : null, "updated_at" : "2016-01-07T12:44:33.959Z", "closed_at" : null, "closed_by" : null, "milestone" : null, "subscribed" : true, "user_notes_count": 0, "due_date": null, "web_url": "http://example.com/my-group/my-project/issues/14", "references": { "short": "#14", "relative": "#14", "full": "my-group/my-project#14" }, "time_stats": { "time_estimate": 0, "total_time_spent": 0, "human_time_estimate": null, "human_total_time_spent": null }, "confidential": false, "discussion_locked": false, "_links": { "self": "http://example.com/api/v4/projects/1/issues/2", "notes": "http://example.com/api/v4/projects/1/issues/2/notes", "award_emoji": "http://example.com/api/v4/projects/1/issues/2/award_emoji", "project": "http://example.com/api/v4/projects/1" }, "task_completion_status":{ "count":0, "completed_count":0 } } ``` 使用 GitLab [Starter,Bronze 或更高版本的用戶](https://about.gitlab.com/pricing/)還將看到`weight`參數: ``` { "project_id" : 4, "description" : null, "weight": null, ... } ``` **注意** :不建議使用`assignee`列,現在我們將其顯示為符合 GitLab EE API 的單一大小的數組`assignees` . **注意** : [GitLab 10.6](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042)中[引入了](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042) `closed_by`屬性. 只有在 GitLab 10.6 之后關閉的問題以及關閉問題的用戶帳戶仍然存在時,才會顯示此值. ## Rate limits[](#rate-limits "Permalink") 為了避免濫用,用戶僅限于: | 請求類型 | Limit | | --- | --- | | Create | 每分鐘 300 期 | ## Edit issue[](#edit-issue "Permalink") 更新現有項目問題. 此調用還用于將問題標記為已結束. ``` PUT /projects/:id/issues/:issue_iid ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | | `title` | string | no | 問題標題 | | `description` | string | no | 問題的描述. 限制為 1,048,576 個字符. | | `confidential` | boolean | no | 將問題更新為機密 | | `assignee_ids` | 整數數組 | no | 要分配問題的用戶的 ID. 設置為`0`或提供一個空值以取消分配所有受讓人. | | `milestone_id` | integer | no | 要分配問題的里程碑的全局 ID. 設置為`0`或提供一個空值以取消分配里程碑. | | `labels` | string | no | 問題的標簽名稱,以逗號分隔. 設置為空字符串以取消分配所有標簽. | | `add_labels` | string | no | 以逗號分隔的標簽名稱添加到問題中. | | `remove_labels` | string | no | 逗號分隔的標簽名稱可從問題中刪除. | | `state_event` | string | no | 問題的狀態事件. 設為`close`以關閉問題,然后`reopen`以重新打開它 | | `updated_at` | string | no | 日期時間字符串,ISO 8601 格式,例如`2016-03-11T03:45:40Z` (需要管理員或項目所有者權限). 不接受空字符串或空值. | | `due_date` | string | no | 日期時間字符串,格式為 YEAR-MONTH-DAY,例如`2016-03-11` | | `weight` | integer | no | 問題的分量. 有效值大于或等于 0.0 | | `discussion_locked` | boolean | no | 指示問題的討論是否被鎖定的標志. 如果討論被鎖定,則只有項目成員可以添加或編輯評論. | | `epic_id` | integer | no | 要添加問題的史詩的 ID. 有效值大于或等于 0. | | `epic_iid` | integer | no | 要添加問題的史詩的 IID. 有效值大于或等于 0.(不建議使用, [將在版本 5 中將其刪除](https://gitlab.com/gitlab-org/gitlab/-/issues/35157) ) | ``` curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/4/issues/85?state_event=close" ``` 響應示例: ``` { "created_at" : "2016-01-07T12:46:01.410Z", "author" : { "name" : "Alexandra Bashirian", "avatar_url" : null, "username" : "eileen.lowe", "id" : 18, "state" : "active", "web_url" : "https://gitlab.example.com/eileen.lowe" }, "state" : "closed", "title" : "Issues with auth", "project_id" : 4, "description" : null, "updated_at" : "2016-01-07T12:55:16.213Z", "closed_at" : "2016-01-08T12:55:16.213Z", "closed_by" : { "state" : "active", "web_url" : "https://gitlab.example.com/root", "avatar_url" : null, "username" : "root", "id" : 1, "name" : "Administrator" }, "iid" : 15, "labels" : [ "bug" ], "upvotes": 4, "downvotes": 0, "merge_requests_count": 0, "id" : 85, "assignees" : [], "assignee" : null, "milestone" : null, "subscribed" : true, "user_notes_count": 0, "due_date": "2016-07-22", "web_url": "http://example.com/my-group/my-project/issues/15", "references": { "short": "#15", "relative": "#15", "full": "my-group/my-project#15" }, "time_stats": { "time_estimate": 0, "total_time_spent": 0, "human_time_estimate": null, "human_total_time_spent": null }, "confidential": false, "discussion_locked": false, "_links": { "self": "http://example.com/api/v4/projects/1/issues/2", "notes": "http://example.com/api/v4/projects/1/issues/2/notes", "award_emoji": "http://example.com/api/v4/projects/1/issues/2/award_emoji", "project": "http://example.com/api/v4/projects/1" }, "task_completion_status":{ "count":0, "completed_count":0 } } ``` 使用 GitLab [Starter,Bronze 或更高版本的用戶](https://about.gitlab.com/pricing/)還將看到`weight`參數: ``` { "project_id" : 4, "description" : null, "weight": null, ... } ``` **注:**至少以下參數之一是需要傳遞的請求是成功的: `:assignee_id` , `:assignee_ids` , `:confidential` , `:created_at` , `:description` , `:discussion_locked` , `:due_date` , `:labels` , `:milestone_id` , `:state_event` ,或`:title` .**注意:**不建議使用`assignee`列. 現在,我們將其顯示為符合 GitLab EE API 的單個大小的數組`assignees` .**注意:** `closed_by`屬性是[在 GitLab 10.6](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042)中[引入的](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042) . 只有在 GitLab 10.6 之后關閉的問題以及關閉問題的用戶帳戶仍然存在時,才會顯示此值. ## Delete an issue[](#delete-an-issue "Permalink") 僅適用于管理員和項目所有者. 刪除相關問題. ``` DELETE /projects/:id/issues/:issue_iid ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | ``` curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/4/issues/85" ``` ## Reorder an issue[](#reorder-an-issue "Permalink") > 作為[社區貢獻](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35349) [引入](https://gitlab.com/gitlab-org/gitlab/-/issues/211864)到 GitLab 13.2 中. 重新排序問題,手動排序問題時可以看到結果 ``` PUT /projects/:id/issues/:issue_iid/reorder ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | | `move_after_id` | integer | no | 一個項目的 ID,以便在以后移動此問題 | | `move_before_id` | integer | no | 一個項目的 ID,以便在此之前移此問題 | ``` curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/4/issues/85/reorder?move_after_id=51&move_before_id=92" ``` ## Move an issue[](#move-an-issue "Permalink") 將問題移到其他項目. 如果目標項目等于源項目,或者用戶沒有足夠的權限來移動問題,則返回錯誤`400`和解釋性錯誤消息. If a given label and/or milestone with the same name also exists in the target project, it will then be assigned to the issue that is being moved. ``` POST /projects/:id/issues/:issue_iid/move ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | | `to_project_id` | integer | yes | 新項目的 ID | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" --form to_project_id=5 "https://gitlab.example.com/api/v4/projects/4/issues/85/move" ``` Example response: ``` { "id": 92, "iid": 11, "project_id": 5, "title": "Sit voluptas tempora quisquam aut doloribus et.", "description": "Repellat voluptas quibusdam voluptatem exercitationem.", "state": "opened", "created_at": "2016-04-05T21:41:45.652Z", "updated_at": "2016-04-07T12:20:17.596Z", "closed_at": null, "closed_by": null, "labels": [], "upvotes": 4, "downvotes": 0, "merge_requests_count": 0, "milestone": null, "assignees": [{ "name": "Miss Monserrate Beier", "username": "axel.block", "id": 12, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon", "web_url": "https://gitlab.example.com/axel.block" }], "assignee": { "name": "Miss Monserrate Beier", "username": "axel.block", "id": 12, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon", "web_url": "https://gitlab.example.com/axel.block" }, "author": { "name": "Kris Steuber", "username": "solon.cremin", "id": 10, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/7a190fecbaa68212a4b68aeb6e3acd10?s=80&d=identicon", "web_url": "https://gitlab.example.com/solon.cremin" }, "due_date": null, "web_url": "http://example.com/my-group/my-project/issues/11", "references": { "short": "#11", "relative": "#11", "full": "my-group/my-project#11" }, "time_stats": { "time_estimate": 0, "total_time_spent": 0, "human_time_estimate": null, "human_total_time_spent": null }, "confidential": false, "discussion_locked": false, "_links": { "self": "http://example.com/api/v4/projects/1/issues/2", "notes": "http://example.com/api/v4/projects/1/issues/2/notes", "award_emoji": "http://example.com/api/v4/projects/1/issues/2/award_emoji", "project": "http://example.com/api/v4/projects/1" }, "task_completion_status":{ "count":0, "completed_count":0 } } ``` 使用 GitLab [Starter,Bronze 或更高版本的用戶](https://about.gitlab.com/pricing/)還將看到`weight`參數: ``` { "project_id": 5, "description": "Repellat voluptas quibusdam voluptatem exercitationem.", "weight": null, ... } ``` **注意** :不建議使用`assignee`列,現在我們將其顯示為符合 GitLab EE API 的單一大小的數組`assignees` . **注意** : [GitLab 10.6](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042)中[引入了](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042) `closed_by`屬性. 只有在 GitLab 10.6 之后關閉的問題以及關閉問題的用戶帳戶仍然存在時,才會顯示此值. ## Subscribe to an issue[](#subscribe-to-an-issue "Permalink") 為經過身份驗證的用戶訂閱問題以接收通知. 如果用戶已經訂閱了該問題,則返回狀態碼`304` . ``` POST /projects/:id/issues/:issue_iid/subscribe ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | ``` curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/93/subscribe" ``` 響應示例: ``` { "id": 92, "iid": 11, "project_id": 5, "title": "Sit voluptas tempora quisquam aut doloribus et.", "description": "Repellat voluptas quibusdam voluptatem exercitationem.", "state": "opened", "created_at": "2016-04-05T21:41:45.652Z", "updated_at": "2016-04-07T12:20:17.596Z", "closed_at": null, "closed_by": null, "labels": [], "upvotes": 4, "downvotes": 0, "merge_requests_count": 0, "milestone": null, "assignees": [{ "name": "Miss Monserrate Beier", "username": "axel.block", "id": 12, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon", "web_url": "https://gitlab.example.com/axel.block" }], "assignee": { "name": "Miss Monserrate Beier", "username": "axel.block", "id": 12, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon", "web_url": "https://gitlab.example.com/axel.block" }, "author": { "name": "Kris Steuber", "username": "solon.cremin", "id": 10, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/7a190fecbaa68212a4b68aeb6e3acd10?s=80&d=identicon", "web_url": "https://gitlab.example.com/solon.cremin" }, "due_date": null, "web_url": "http://example.com/my-group/my-project/issues/11", "references": { "short": "#11", "relative": "#11", "full": "my-group/my-project#11" }, "time_stats": { "time_estimate": 0, "total_time_spent": 0, "human_time_estimate": null, "human_total_time_spent": null }, "confidential": false, "discussion_locked": false, "_links": { "self": "http://example.com/api/v4/projects/1/issues/2", "notes": "http://example.com/api/v4/projects/1/issues/2/notes", "award_emoji": "http://example.com/api/v4/projects/1/issues/2/award_emoji", "project": "http://example.com/api/v4/projects/1" }, "task_completion_status":{ "count":0, "completed_count":0 } } ``` 使用 GitLab [Starter,Bronze 或更高版本的用戶](https://about.gitlab.com/pricing/)還將看到`weight`參數: ``` { "project_id": 5, "description": "Repellat voluptas quibusdam voluptatem exercitationem.", "weight": null, ... } ``` **注意** :不建議使用`assignee`列,現在我們將其顯示為符合 GitLab EE API 的單一大小的數組`assignees` . **注意** : [GitLab 10.6](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042)中[引入了](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042) `closed_by`屬性. 只有在 GitLab 10.6 之后關閉的問題以及關閉問題的用戶帳戶仍然存在時,才會顯示此值. ## Unsubscribe from an issue[](#unsubscribe-from-an-issue "Permalink") 從問題中退訂已認證的用戶,以不接收來自該問題的通知. 如果用戶未訂閱該問題,則返回狀態碼`304` . ``` POST /projects/:id/issues/:issue_iid/unsubscribe ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | ``` curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/93/unsubscribe" ``` 響應示例: ``` { "id": 93, "iid": 12, "project_id": 5, "title": "Incidunt et rerum ea expedita iure quibusdam.", "description": "Et cumque architecto sed aut ipsam.", "state": "opened", "created_at": "2016-04-05T21:41:45.217Z", "updated_at": "2016-04-07T13:02:37.905Z", "labels": [], "upvotes": 4, "downvotes": 0, "merge_requests_count": 0, "milestone": null, "assignee": { "name": "Edwardo Grady", "username": "keyon", "id": 21, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/3e6f06a86cf27fa8b56f3f74f7615987?s=80&d=identicon", "web_url": "https://gitlab.example.com/keyon" }, "closed_at": null, "closed_by": null, "author": { "name": "Vivian Hermann", "username": "orville", "id": 11, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/5224fd70153710e92fb8bcf79ac29d67?s=80&d=identicon", "web_url": "https://gitlab.example.com/orville" }, "subscribed": false, "due_date": null, "web_url": "http://example.com/my-group/my-project/issues/12", "references": { "short": "#12", "relative": "#12", "full": "my-group/my-project#12" }, "confidential": false, "discussion_locked": false, "task_completion_status":{ "count":0, "completed_count":0 } } ``` ## Create a todo[](#create-a-todo "Permalink") 在問題上為當前用戶手動創建待辦事項. 如果在該問題上已經存在用戶的待辦事項,則返回狀態碼`304` . ``` POST /projects/:id/issues/:issue_iid/todo ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | ``` curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/93/todo" ``` 響應示例: ``` { "id": 112, "project": { "id": 5, "name": "GitLab CI/CD", "name_with_namespace": "GitLab Org / GitLab CI/CD", "path": "gitlab-ci", "path_with_namespace": "gitlab-org/gitlab-ci" }, "author": { "name": "Administrator", "username": "root", "id": 1, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", "web_url": "https://gitlab.example.com/root" }, "action_name": "marked", "target_type": "Issue", "target": { "id": 93, "iid": 10, "project_id": 5, "title": "Vel voluptas atque dicta mollitia adipisci qui at.", "description": "Tempora laboriosam sint magni sed voluptas similique.", "state": "closed", "created_at": "2016-06-17T07:47:39.486Z", "updated_at": "2016-07-01T11:09:13.998Z", "labels": [], "milestone": { "id": 26, "iid": 1, "project_id": 5, "title": "v0.0", "description": "Accusantium nostrum rerum quae quia quis nesciunt suscipit id.", "state": "closed", "created_at": "2016-06-17T07:47:33.832Z", "updated_at": "2016-06-17T07:47:33.832Z", "due_date": null }, "assignees": [{ "name": "Jarret O'Keefe", "username": "francisca", "id": 14, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/a7fa515d53450023c83d62986d0658a8?s=80&d=identicon", "web_url": "https://gitlab.example.com/francisca" }], "assignee": { "name": "Jarret O'Keefe", "username": "francisca", "id": 14, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/a7fa515d53450023c83d62986d0658a8?s=80&d=identicon", "web_url": "https://gitlab.example.com/francisca" }, "author": { "name": "Maxie Medhurst", "username": "craig_rutherford", "id": 12, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/a0d477b3ea21970ce6ffcbb817b0b435?s=80&d=identicon", "web_url": "https://gitlab.example.com/craig_rutherford" }, "subscribed": true, "user_notes_count": 7, "upvotes": 0, "downvotes": 0, "merge_requests_count": 0, "due_date": null, "web_url": "http://example.com/my-group/my-project/issues/10", "references": { "short": "#10", "relative": "#10", "full": "my-group/my-project#10" }, "confidential": false, "discussion_locked": false, "task_completion_status":{ "count":0, "completed_count":0 } }, "target_url": "https://gitlab.example.com/gitlab-org/gitlab-ci/issues/10", "body": "Vel voluptas atque dicta mollitia adipisci qui at.", "state": "pending", "created_at": "2016-07-01T11:09:13.992Z" } ``` **注意** :不建議使用`assignee`列,現在我們將其顯示為符合 GitLab EE API 的單一大小的數組`assignees` . **注意** : [GitLab 10.6](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042)中[引入了](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042) `closed_by`屬性. 只有在 GitLab 10.6 之后關閉的問題以及關閉問題的用戶帳戶仍然存在時,才會顯示此值. ## Set a time estimate for an issue[](#set-a-time-estimate-for-an-issue "Permalink") 設置此問題的估計工作時間. ``` POST /projects/:id/issues/:issue_iid/time_estimate ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | | `duration` | string | yes | 以人類格式表示的持續時間. 例如:3h30m | ``` curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/93/time_estimate?duration=3h30m" ``` 響應示例: ``` { "human_time_estimate": "3h 30m", "human_total_time_spent": null, "time_estimate": 12600, "total_time_spent": 0 } ``` ## Reset the time estimate for an issue[](#reset-the-time-estimate-for-an-issue "Permalink") 將此問題的估計時間重置為 0 秒. ``` POST /projects/:id/issues/:issue_iid/reset_time_estimate ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | ``` curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/93/reset_time_estimate" ``` 響應示例: ``` { "human_time_estimate": null, "human_total_time_spent": null, "time_estimate": 0, "total_time_spent": 0 } ``` ## Add spent time for an issue[](#add-spent-time-for-an-issue "Permalink") 增加了解決此問題的時間 ``` POST /projects/:id/issues/:issue_iid/add_spent_time ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | | `duration` | string | yes | 以人類格式表示的持續時間. 例如:3h30m | ``` curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/93/add_spent_time?duration=1h" ``` Example response: ``` { "human_time_estimate": null, "human_total_time_spent": "1h", "time_estimate": 0, "total_time_spent": 3600 } ``` ## Reset spent time for an issue[](#reset-spent-time-for-an-issue "Permalink") 將此問題的總花費時間重置為 0 秒. ``` POST /projects/:id/issues/:issue_iid/reset_spent_time ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | ``` curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/93/reset_spent_time" ``` 響應示例: ``` { "human_time_estimate": null, "human_total_time_spent": null, "time_estimate": 0, "total_time_spent": 0 } ``` ## Get time tracking stats[](#get-time-tracking-stats "Permalink") 如果項目為私人項目或問題為機密,則需要提供憑據進行授權. 首選的方法是使用[個人訪問令牌](../user/profile/personal_access_tokens.html) . ``` GET /projects/:id/issues/:issue_iid/time_stats ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/93/time_stats" ``` 響應示例: ``` { "human_time_estimate": "2h", "human_total_time_spent": "1h", "time_estimate": 7200, "total_time_spent": 3600 } ``` ## List merge requests related to issue[](#list-merge-requests-related-to-issue "Permalink") 獲取與該問題相關的所有合并請求. 如果項目為私人項目或問題為機密,則需要提供憑據進行授權. 首選的方法是使用[個人訪問令牌](../user/profile/personal_access_tokens.html) . ``` GET /projects/:id/issues/:issue_id/related_merge_requests ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/issues/11/related_merge_requests" ``` 響應示例: ``` [ { "id": 29, "iid": 11, "project_id": 1, "title": "Provident eius eos blanditiis consequatur neque odit.", "description": "Ut consequatur ipsa aspernatur quisquam voluptatum fugit. Qui harum corporis quo fuga ut incidunt veritatis. Autem necessitatibus et harum occaecati nihil ea.\r\n\r\ntwitter/flight#8", "state": "opened", "created_at": "2018-09-18T14:36:15.510Z", "updated_at": "2018-09-19T07:45:13.089Z", "closed_by": null, "closed_at": null, "target_branch": "v2.x", "source_branch": "so_long_jquery", "user_notes_count": 9, "upvotes": 0, "downvotes": 0, "author": { "id": 14, "name": "Verna Hills", "username": "lawanda_reinger", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/de68a91aeab1cff563795fb98a0c2cc0?s=80&d=identicon", "web_url": "https://gitlab.example.com/lawanda_reinger" }, "assignee": { "id": 19, "name": "Jody Baumbach", "username": "felipa.kuvalis", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/6541fc75fc4e87e203529bd275fafd07?s=80&d=identicon", "web_url": "https://gitlab.example.com/felipa.kuvalis" }, "source_project_id": 1, "target_project_id": 1, "labels": [], "work_in_progress": false, "milestone": { "id": 27, "iid": 2, "project_id": 1, "title": "v1.0", "description": "Et tenetur voluptatem minima doloribus vero dignissimos vitae.", "state": "active", "created_at": "2018-09-18T14:35:44.353Z", "updated_at": "2018-09-18T14:35:44.353Z", "due_date": null, "start_date": null, "web_url": "https://gitlab.example.com/twitter/flight/milestones/2" }, "merge_when_pipeline_succeeds": false, "merge_status": "cannot_be_merged", "sha": "3b7b528e9353295c1c125dad281ac5b5deae5f12", "merge_commit_sha": null, "squash_commit_sha": null, "discussion_locked": null, "should_remove_source_branch": null, "force_remove_source_branch": false, "reference": "!11", "web_url": "https://gitlab.example.com/twitter/flight/merge_requests/4", "references": { "short": "!4", "relative": "!4", "full": "twitter/flight!4" }, "time_stats": { "time_estimate": 0, "total_time_spent": 0, "human_time_estimate": null, "human_total_time_spent": null }, "squash": false, "task_completion_status": { "count": 0, "completed_count": 0 }, "changes_count": "10", "latest_build_started_at": "2018-12-05T01:16:41.723Z", "latest_build_finished_at": "2018-12-05T02:35:54.046Z", "first_deployed_to_production_at": null, "pipeline": { "id": 38980952, "sha": "81c6a84c7aebd45a1ac2c654aa87f11e32338e0a", "ref": "test-branch", "status": "success", "web_url": "https://gitlab.com/gitlab-org/gitlab/pipelines/38980952" }, "head_pipeline": { "id": 38980952, "sha": "81c6a84c7aebd45a1ac2c654aa87f11e32338e0a", "ref": "test-branch", "status": "success", "web_url": "https://gitlab.example.com/twitter/flight/pipelines/38980952", "before_sha": "3c738a37eb23cf4c0ed0d45d6ddde8aad4a8da51", "tag": false, "yaml_errors": null, "user": { "id": 19, "name": "Jody Baumbach", "username": "felipa.kuvalis", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/6541fc75fc4e87e203529bd275fafd07?s=80&d=identicon", "web_url": "https://gitlab.example.com/felipa.kuvalis" }, "created_at": "2018-12-05T01:16:13.342Z", "updated_at": "2018-12-05T02:35:54.086Z", "started_at": "2018-12-05T01:16:41.723Z", "finished_at": "2018-12-05T02:35:54.046Z", "committed_at": null, "duration": 4436, "coverage": "46.68", "detailed_status": { "icon": "status_warning", "text": "passed", "label": "passed with warnings", "group": "success-with-warnings", "tooltip": "passed", "has_details": true, "details_path": "/twitter/flight/pipelines/38", "illustration": null, "favicon": "https://gitlab.example.com/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" } }, "diff_refs": { "base_sha": "d052d768f0126e8cddf80afd8b1eb07f406a3fcb", "head_sha": "81c6a84c7aebd45a1ac2c654aa87f11e32338e0a", "start_sha": "d052d768f0126e8cddf80afd8b1eb07f406a3fcb" }, "merge_error": null, "user": { "can_merge": true } } ] ``` ## List merge requests that will close issue on merge[](#list-merge-requests-that-will-close-issue-on-merge "Permalink") 獲取所有合并請求,這些合并請求將在合并時關閉問題. 如果項目為私人項目或問題為機密,則需要提供憑據進行授權. 首選的方法是使用[個人訪問令牌](../user/profile/personal_access_tokens.html) . ``` GET /projects/:id/issues/:issue_iid/closed_by ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer | yes | 項目 ID | | `issue_iid` | integer | yes | 項目問題的內部 ID | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/issues/11/closed_by" ``` 響應示例: ``` [ { "id": 6471, "iid": 6432, "project_id": 1, "title": "add a test for cgi lexer options", "description": "closes #11", "state": "opened", "created_at": "2017-04-06T18:33:34.168Z", "updated_at": "2017-04-09T20:10:24.983Z", "target_branch": "master", "source_branch": "feature.custom-highlighting", "upvotes": 0, "downvotes": 0, "author": { "name": "Administrator", "username": "root", "id": 1, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", "web_url": "https://gitlab.example.com/root" }, "assignee": null, "source_project_id": 1, "target_project_id": 1, "closed_at": null, "closed_by": null, "labels": [], "work_in_progress": false, "milestone": null, "merge_when_pipeline_succeeds": false, "merge_status": "unchecked", "sha": "5a62481d563af92b8e32d735f2fa63b94e806835", "merge_commit_sha": null, "squash_commit_sha": null, "user_notes_count": 1, "should_remove_source_branch": null, "force_remove_source_branch": false, "web_url": "https://gitlab.example.com/gitlab-org/gitlab-test/merge_requests/6432", "reference": "!6432", "references": { "short": "!6432", "relative": "!6432", "full": "gitlab-org/gitlab-test!6432" }, "time_stats": { "time_estimate": 0, "total_time_spent": 0, "human_time_estimate": null, "human_total_time_spent": null } } ] ``` ## Participants on issues[](#participants-on-issues "Permalink") 如果項目為私人項目或問題為機密,則需要提供憑據進行授權. 首選的方法是使用[個人訪問令牌](../user/profile/personal_access_tokens.html) . ``` GET /projects/:id/issues/:issue_iid/participants ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | 項目問題的內部 ID | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/93/participants" ``` 響應示例: ``` [ { "id": 1, "name": "John Doe1", "username": "user1", "state": "active", "avatar_url": "http://www.gravatar.com/avatar/c922747a93b40d1ea88262bf1aebee62?s=80&d=identicon", "web_url": "http://localhost/user1" }, { "id": 5, "name": "John Doe5", "username": "user5", "state": "active", "avatar_url": "http://www.gravatar.com/avatar/4aea8cf834ed91844a2da4ff7ae6b491?s=80&d=identicon", "web_url": "http://localhost/user5" } ] ``` ## Comments on issues[](#comments-on-issues "Permalink") 注釋是通過[notes](notes.html)資源完成的. ## Get user agent details[](#get-user-agent-details "Permalink") 僅適用于管理員. ``` GET /projects/:id/issues/:issue_iid/user_agent_detail ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `issue_iid` | integer | yes | The internal ID of a project’s issue | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/93/user_agent_detail" ``` 響應示例: ``` { "user_agent": "AppleWebKit/537.36", "ip_address": "127.0.0.1", "akismet_submitted": false } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看