Skip to content

Commit d2ff505

Browse files
committed
New Datasource gitlab_project_issues
Refs #746
1 parent 4b96220 commit d2ff505

File tree

8 files changed

+566
-15
lines changed

8 files changed

+566
-15
lines changed

docs/data-sources/project_issue.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
page_title: "gitlab_project_issue Data Source - terraform-provider-gitlab"
44
subcategory: ""
55
description: |-
6-
This data source allows you to access GitLab Project Issues.
6+
The gitlab_project_issue data source allows to retrieve details about an issue in a project.
77
Upstream API: GitLab API docs https://docs.gitlab.com/ee/api/issues.html
88
---
99

1010
# gitlab_project_issue (Data Source)
1111

12-
This data source allows you to access GitLab Project Issues.
12+
The `gitlab_project_issue` data source allows to retrieve details about an issue in a project.
1313

1414
**Upstream API:** [GitLab API docs](https://docs.gitlab.com/ee/api/issues.html)
1515

docs/data-sources/project_issues.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "gitlab_project_issues Data Source - terraform-provider-gitlab"
4+
subcategory: ""
5+
description: |-
6+
The gitlab_project_issues data source allows to retrieve details about issues in a project.
7+
Upstream API: GitLab API docs https://docs.gitlab.com/ee/api/issues.html
8+
---
9+
10+
# gitlab_project_issues (Data Source)
11+
12+
The `gitlab_project_issues` data source allows to retrieve details about issues in a project.
13+
14+
**Upstream API:** [GitLab API docs](https://docs.gitlab.com/ee/api/issues.html)
15+
16+
## Example Usage
17+
18+
```terraform
19+
data "gitlab_project" "foo" {
20+
id = "foo/bar/baz"
21+
}
22+
23+
data "gitlab_project_issues" "all_with_foo" {
24+
project = data.gitlab_project.foo.id
25+
search = "foo"
26+
}
27+
```
28+
29+
<!-- schema generated by tfplugindocs -->
30+
## Schema
31+
32+
### Required
33+
34+
- **project** (String) The name or id of the project.
35+
36+
### Optional
37+
38+
- **assignee_id** (Number) Return issues assigned to the given user id. Mutually exclusive with assignee_username. None returns unassigned issues. Any returns issues with an assignee.
39+
- **assignee_username** (String) Return issues assigned to the given username. Similar to assignee_id and mutually exclusive with assignee_id. In GitLab CE, the assignee_username array should only contain a single value. Otherwise, an invalid parameter error is returned.
40+
- **author_id** (Number) Return issues created by the given user id. Combine with scope=all or scope=assigned_to_me.
41+
- **confidential** (Boolean) Filter confidential or public issues.
42+
- **created_after** (String) Return issues created on or after the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
43+
- **created_before** (String) Return issues created on or before the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
44+
- **due_date** (String) Return issues that have no due date, are overdue, or whose due date is this week, this month, or between two weeks ago and next month. Accepts: 0 (no due date), any, today, tomorrow, overdue, week, month, next_month_and_previous_two_weeks.
45+
- **id** (String) The ID of this resource.
46+
- **iids** (List of Number) Return only the issues having the given iid
47+
- **issue_type** (String) Filter to a given type of issue. Valid values are [issue incident test_case]. (Introduced in GitLab 13.12)
48+
- **labels** (List of String) Return issues with labels. 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.
49+
- **milestone** (String) The milestone title. None lists all issues with no milestone. Any lists all issues that have an assigned milestone.
50+
- **my_reaction_emoji** (String) Return issues reacted by the authenticated user by the given emoji. None returns issues not given a reaction. Any returns issues given at least one reaction.
51+
- **not_assignee_id** (List of Number) Return issues that do not match the assignee id.
52+
- **not_author_id** (List of Number) Return issues that do not match the author id.
53+
- **not_labels** (List of String) Return issues that do not match the labels.
54+
- **not_milestone** (List of String) Return issues that do not match the milestone.
55+
- **not_my_reaction_emoji** (List of String) Return issues not reacted by the authenticated user by the given emoji.
56+
- **order_by** (String) Return issues ordered by. Valid values are `created_at`, `updated_at`, `priority`, `due_date`, `relative_position`, `label_priority`, `milestone_due`, `popularity`, `weight`. Default is created_at
57+
- **scope** (String) Return issues for the given scope. Valid values are `created_by_me`, `assigned_to_me`, `all`. Defaults to all.
58+
- **search** (String) Search project issues against their title and description
59+
- **sort** (String) Return issues sorted in asc or desc order. Default is desc
60+
- **updated_after** (String) Return issues updated on or after the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
61+
- **updated_before** (String) Return issues updated on or before the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
62+
- **weight** (Number) Return issues with the specified weight. None returns issues with no weight assigned. Any returns issues with a weight assigned.
63+
- **with_labels_details** (Boolean) If true, the response returns more details for each label in labels field: :name, :color, :description, :description_html, :text_color. Default is false. description_html was introduced in GitLab 12.7
64+
65+
### Read-Only
66+
67+
- **issues** (List of Object) The list of issues returned by the search. (see [below for nested schema](#nestedatt--issues))
68+
69+
<a id="nestedatt--issues"></a>
70+
### Nested Schema for `issues`
71+
72+
Read-Only:
73+
74+
- **assignee_ids** (Set of Number)
75+
- **author_id** (Number)
76+
- **closed_at** (String)
77+
- **closed_by_user_id** (Number)
78+
- **confidential** (Boolean)
79+
- **created_at** (String)
80+
- **description** (String)
81+
- **discussion_locked** (Boolean)
82+
- **discussion_to_resolve** (String)
83+
- **downvotes** (Number)
84+
- **due_date** (String)
85+
- **epic_id** (Number)
86+
- **epic_issue_id** (Number)
87+
- **external_id** (String)
88+
- **human_time_estimate** (String)
89+
- **human_total_time_spent** (String)
90+
- **iid** (Number)
91+
- **issue_id** (Number)
92+
- **issue_link_id** (Number)
93+
- **issue_type** (String)
94+
- **labels** (Set of String)
95+
- **links** (Map of String)
96+
- **merge_request_to_resolve_discussions_of** (Number)
97+
- **merge_requests_count** (Number)
98+
- **milestone_id** (Number)
99+
- **moved_to_id** (Number)
100+
- **project** (String)
101+
- **references** (Map of String)
102+
- **state** (String)
103+
- **subscribed** (Boolean)
104+
- **task_completion_status** (List of Object) (see [below for nested schema](#nestedobjatt--issues--task_completion_status))
105+
- **time_estimate** (Number)
106+
- **title** (String)
107+
- **total_time_spent** (Number)
108+
- **updated_at** (String)
109+
- **upvotes** (Number)
110+
- **user_notes_count** (Number)
111+
- **web_url** (String)
112+
- **weight** (Number)
113+
114+
<a id="nestedobjatt--issues--task_completion_status"></a>
115+
### Nested Schema for `issues.task_completion_status`
116+
117+
Read-Only:
118+
119+
- **completed_count** (Number)
120+
- **count** (Number)
121+
122+

docs/resources/project_issue.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@
33
page_title: "gitlab_project_issue Resource - terraform-provider-gitlab"
44
subcategory: ""
55
description: |-
6-
This resource allows you to create and manage GitLab Project Issues.
7-
During a terraform destroy this resource will close the issue.
8-
Set the deleteondestroy flag to true to delete the issue instead of closing it.
9-
Experimental: while the base functionality of this resource works, it may be subject to minor change.
6+
The gitlab_project_issue resource allows to manage the lifecycle of an issue within a project.
7+
-> During a terraform destroy this resource will close the issue. Set the deleteondestroy flag to true to delete the issue instead of closing it.
8+
~> Experimental: while the base functionality of this resource works, it may be subject to minor change.
109
Upstream API: GitLab API docs https://docs.gitlab.com/ee/api/issues.html
1110
---
1211

1312
# gitlab_project_issue (Resource)
1413

15-
This resource allows you to create and manage GitLab Project Issues.
14+
The `gitlab_project_issue` resource allows to manage the lifecycle of an issue within a project.
1615

17-
During a terraform destroy this resource will close the issue.
18-
Set the delete_on_destroy flag to true to delete the issue instead of closing it.
16+
-> During a terraform destroy this resource will close the issue. Set the delete_on_destroy flag to true to delete the issue instead of closing it.
1917

20-
**Experimental**: while the base functionality of this resource works, it may be subject to minor change.
18+
~> **Experimental**: while the base functionality of this resource works, it may be subject to minor change.
2119

2220
**Upstream API:** [GitLab API docs](https://docs.gitlab.com/ee/api/issues.html)
2321

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
data "gitlab_project" "foo" {
2+
id = "foo/bar/baz"
3+
}
4+
5+
data "gitlab_project_issues" "all_with_foo" {
6+
project = data.gitlab_project.foo.id
7+
search = "foo"
8+
}

internal/provider/data_source_gitlab_project_issue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
var _ = registerDataSource("gitlab_project_issue", func() *schema.Resource {
1212
return &schema.Resource{
13-
Description: `This data source allows you to access GitLab Project Issues.
13+
Description: `The ` + "`gitlab_project_issue`" + ` data source allows to retrieve details about an issue in a project.
1414
1515
**Upstream API:** [GitLab API docs](https://docs.gitlab.com/ee/api/issues.html)`,
1616

0 commit comments

Comments
 (0)