# Resource weight events API

> 原文：[https://docs.gitlab.com/ee/api/resource_weight_events.html](https://docs.gitlab.com/ee/api/resource_weight_events.html)

*   [Issues](#issues)
    *   [List project issue weight events](#list-project-issue-weight-events)
    *   [Get single issue weight event](#get-single-issue-weight-event)

# Resource weight events API[](#resource-weight-events-api "Permalink")

资源权重事件跟踪 GitLab [问题的](../user/project/issues/)发生情况.

使用它们来跟踪设置了哪些权重，由谁进行权重以及何时发生.

## Issues[](#issues "Permalink")

### List project issue weight events[](#list-project-issue-weight-events "Permalink")

获取单个问题的所有举重事件的列表.

```
GET /projects/:id/issues/:issue_iid/resource_weight_events 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `issue_iid` | integer | yes | 问题的 IID |

请求示例：

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/11/resource_weight_events" 
```

响应示例：

```
[  {  "id":  142,  "user":  {  "id":  1,  "name":  "Administrator",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",  "web_url":  "http://gitlab.example.com/root"  },  "created_at":  "2018-08-20T13:38:20.077Z",  "issue_id":  253,  "weight":  3  },  {  "id":  143,  "user":  {  "id":  1,  "name":  "Administrator",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",  "web_url":  "http://gitlab.example.com/root"  },  "created_at":  "2018-08-21T14:38:20.077Z",  "issue_id":  253,  "weight":  2  }  ] 
```

### Get single issue weight event[](#get-single-issue-weight-event "Permalink")

返回特定项目问题的单个权重事件

```
GET /projects/:id/issues/:issue_iid/resource_weight_events/:resource_weight_event_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `issue_iid` | integer | yes | 问题的 IID |
| `resource_weight_event_id` | integer | yes | 举重事件的 ID |

请求示例：

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/11/resource_weight_events/143" 
```

响应示例：

```
{  "id":  143,  "user":  {  "id":  1,  "name":  "Administrator",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",  "web_url":  "http://gitlab.example.com/root"  },  "created_at":  "2018-08-21T14:38:20.077Z",  "issue_id":  253,  "weight":  2  } 
```