|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "gitlab_project_merge_requests Data Source - terraform-provider-gitlab" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + The gitlab_project_merge_requests data source retrieves |
| 7 | + information about a list of merge requests related to a specific project. |
| 8 | + Upstream API: GitLab REST API docs https://docs.gitlab.com/api/merge_requests/#list-project-merge-requests |
| 9 | +--- |
| 10 | + |
| 11 | +# gitlab_project_merge_requests (Data Source) |
| 12 | + |
| 13 | +The `gitlab_project_merge_requests` data source retrieves |
| 14 | +information about a list of merge requests related to a specific project. |
| 15 | + |
| 16 | +**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/merge_requests/#list-project-merge-requests) |
| 17 | + |
| 18 | +## Example Usage |
| 19 | + |
| 20 | +```terraform |
| 21 | +data "gitlab_project_merge_requests" "example_one" { |
| 22 | + project = "123" |
| 23 | + target_branch = "main" |
| 24 | + wip = "yes" |
| 25 | +} |
| 26 | +
|
| 27 | +data "gitlab_project_merge_requests" "example_two" { |
| 28 | + project = "company/group/project1" |
| 29 | + author_id = 5 |
| 30 | + created_after = "2024-07-25T12:00:00Z" |
| 31 | +} |
| 32 | +``` |
| 33 | + |
| 34 | +<!-- schema generated by tfplugindocs --> |
| 35 | +## Schema |
| 36 | + |
| 37 | +### Required |
| 38 | + |
| 39 | +- `project` (String) The ID or path of the project. |
| 40 | + |
| 41 | +### Optional |
| 42 | + |
| 43 | +- `author_id` (Number) Return merge requests created by the given user ID. |
| 44 | +- `author_username` (String) Return merge requests created by the given username. |
| 45 | +- `created_after` (String) Return merge requests created after the given time. Expected in RFC3339 format (2006-01-02T15:04:05Z). |
| 46 | +- `created_before` (String) Return merge requests created before the given time. Expected in RFC3339 format (2006-01-02T15:04:05Z). |
| 47 | +- `iids` (List of Number) The unique internal IDs of the merge requests. |
| 48 | +- `milestone` (String) Return only merge requests for a specific milestone. `None` returns merge requests with no milestone. `Any` returns merge requests that have an assigned milestone. |
| 49 | +- `my_reaction_emoji` (String) Return merge requests reacted to by the authenticated user with the given emoji. `None` returns issues not given a reaction. `Any` returns issues given at least one reaction. |
| 50 | +- `order_by` (String) Return requests ordered by `created_at`, `title` or `updated_at`. Default is `created_at`. |
| 51 | +- `reviewer_username` (String) Return merge requests reviewed by the given username. `None` returns merge requests with no reviews. `Any` returns merge requests with any reviewer. |
| 52 | +- `scope` (String) Return merge requests for the given scope: `created_by_me`, `assigned_to_me`, or `all`. |
| 53 | +- `search` (String) Search merge requests against their `title` or `description`. |
| 54 | +- `sort` (String) Return requests sorted in `asc` or `desc` order. Default is `desc`. |
| 55 | +- `source_branch` (String) Return merge requests with the given source branch. |
| 56 | +- `state` (String) Return all merge requests (all) or just those that are opened, closed, locked, or merged. |
| 57 | +- `target_branch` (String) Return merge requests with the given target branch. |
| 58 | +- `updated_after` (String) Return merge requests updated after the given time. Expected in RFC3339 format (2006-01-02T15:04:05Z). |
| 59 | +- `updated_before` (String) Return merge requests updated before the given time. Expected in RFC3339 format (2006-01-02T15:04:05Z). |
| 60 | +- `wip` (String) Filter merge requests against their wip status. `yes` to return only draft merge requests, `no` to return non-draft merge requests. |
| 61 | + |
| 62 | +### Read-Only |
| 63 | + |
| 64 | +- `merge_requests` (Attributes List) The list of merge requests. (see [below for nested schema](#nestedatt--merge_requests)) |
| 65 | + |
| 66 | +<a id="nestedatt--merge_requests"></a> |
| 67 | +### Nested Schema for `merge_requests` |
| 68 | + |
| 69 | +Read-Only: |
| 70 | + |
| 71 | +- `assignee` (Attributes) First assignee of the merge request. (see [below for nested schema](#nestedatt--merge_requests--assignee)) |
| 72 | +- `assignees` (Attributes List) Assignees of the merge request. (see [below for nested schema](#nestedatt--merge_requests--assignees)) |
| 73 | +- `author` (Attributes) User who created this merge request. (see [below for nested schema](#nestedatt--merge_requests--author)) |
| 74 | +- `blocking_discussions_resolved` (Boolean) Indicates if all discussions are resolved only if all are |
| 75 | +required before merge request can be merged. |
| 76 | +- `closed_at` (String) Timestamp of when the merge request was closed. |
| 77 | +- `closed_by` (Attributes) User who closed this merge request. (see [below for nested schema](#nestedatt--merge_requests--closed_by)) |
| 78 | +- `created_at` (String) Timestamp of when the merge request was created. |
| 79 | +- `id` (Number) The unique instance level ID of the merge request. |
| 80 | +- `iid` (Number) The unique project level ID of the merge request. |
| 81 | + |
| 82 | +<a id="nestedatt--merge_requests--assignee"></a> |
| 83 | +### Nested Schema for `merge_requests.assignee` |
| 84 | + |
| 85 | +Read-Only: |
| 86 | + |
| 87 | +- `avatar_url` (String) A link to the user's avatar image. |
| 88 | +- `id` (Number) The internal ID number of the user. |
| 89 | +- `name` (String) The name of the user. |
| 90 | +- `state` (String) The state of the user account. |
| 91 | +- `username` (String) The username of the user. |
| 92 | +- `web_url` (String) A link to the user's profile page. |
| 93 | + |
| 94 | + |
| 95 | +<a id="nestedatt--merge_requests--assignees"></a> |
| 96 | +### Nested Schema for `merge_requests.assignees` |
| 97 | + |
| 98 | +Read-Only: |
| 99 | + |
| 100 | +- `avatar_url` (String) A link to the user's avatar image. |
| 101 | +- `id` (Number) The internal ID number of the user. |
| 102 | +- `name` (String) The name of the user. |
| 103 | +- `state` (String) The state of the user account. |
| 104 | +- `username` (String) The username of the user. |
| 105 | +- `web_url` (String) A link to the user's profile page. |
| 106 | + |
| 107 | + |
| 108 | +<a id="nestedatt--merge_requests--author"></a> |
| 109 | +### Nested Schema for `merge_requests.author` |
| 110 | + |
| 111 | +Read-Only: |
| 112 | + |
| 113 | +- `avatar_url` (String) A link to the user's avatar image. |
| 114 | +- `id` (Number) The internal ID number of the user. |
| 115 | +- `name` (String) The name of the user. |
| 116 | +- `state` (String) The state of the user account. |
| 117 | +- `username` (String) The username of the user. |
| 118 | +- `web_url` (String) A link to the user's profile page. |
| 119 | + |
| 120 | + |
| 121 | +<a id="nestedatt--merge_requests--closed_by"></a> |
| 122 | +### Nested Schema for `merge_requests.closed_by` |
| 123 | + |
| 124 | +Read-Only: |
| 125 | + |
| 126 | +- `avatar_url` (String) A link to the user's avatar image. |
| 127 | +- `id` (Number) The internal ID number of the user. |
| 128 | +- `name` (String) The name of the user. |
| 129 | +- `state` (String) The state of the user account. |
| 130 | +- `username` (String) The username of the user. |
| 131 | +- `web_url` (String) A link to the user's profile page. |
0 commit comments