Skip to content

Commit 45f806c

Browse files
fix: iids not working as a list in projects.issues.list()
Set the 'iids' values as type ListAttribute so it will pass the list as a comma-separated string, instead of a list. Add a functional test. Closes: #1407
1 parent 909aa9a commit 45f806c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

gitlab/v4/objects/issues.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class ProjectIssueManager(CRUDMixin, RESTManager):
220220
"discussion_locked",
221221
),
222222
)
223-
_types = {"labels": types.ListAttribute}
223+
_types = {"iids": types.ListAttribute, "labels": types.ListAttribute}
224224

225225

226226
class ProjectIssueLink(ObjectDeleteMixin, RESTObject):

tools/functional/api/test_issues.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
def test_create_issue(project):
55
issue = project.issues.create({"title": "my issue 1"})
66
issue2 = project.issues.create({"title": "my issue 2"})
7-
assert len(project.issues.list()) == 2
7+
issue_ids = [issue.id for issue in project.issues.list()]
8+
assert len(issue_ids) == 2
9+
10+
# Test 'iids' as a list
11+
assert len(project.issues.list(iids=issue_ids)) == 2
812

913
issue2.state_event = "close"
1014
issue2.save()

0 commit comments

Comments
 (0)