Skip to content

Commit 3365cc1

Browse files
committed
doc(api): Add documentation for iterations
1 parent 2f2fd03 commit 3365cc1

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

docs/api-objects.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ API examples
2424
gl_objects/geo_nodes
2525
gl_objects/groups
2626
gl_objects/issues
27+
gl_objects/iterations
2728
gl_objects/boards
2829
gl_objects/labels
2930
gl_objects/notifications

docs/gl_objects/iterations.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
##########
2+
Iterations
3+
##########
4+
5+
Project Iterations
6+
==================
7+
8+
Reference
9+
---------
10+
11+
* v4 API:
12+
13+
+ :class:`gitlab.v4.objects.ProjectIteration`
14+
+ :class:`gitlab.v4.objects.ProjectIterationManager`
15+
+ :attr:`gitlab.v4.objects.Project.iterations`
16+
17+
+ :class:`gitlab.v4.objects.GroupIteration`
18+
+ :class:`gitlab.v4.objects.GroupIterationManager`
19+
+ :attr:`gitlab.v4.objects.Group.iterations`
20+
21+
* GitLab API:
22+
23+
+ https://docs.gitlab.com/ee/api/iterations.html
24+
+ https://docs.gitlab.com/ee/api/group_iterations.html
25+
26+
Examples
27+
--------
28+
29+
List the iterations for a project or a group::
30+
31+
p_iterations = project.iterations.list()
32+
g_iterations = group.iterations.list()
33+
34+
You can filter the list using the following parameters:
35+
36+
* ``iids``: unique IDs of iterations for the project
37+
* ``state``: either ``opened``, ``upcoming``, ``started``, ``closed``, or ``all`` iterations. Defaults to ``all``.
38+
* ``search``: search only iterations with a title matching the provided string.
39+
40+
41+
::
42+
43+
p_iterationss = project.iterations.list(state='closed')
44+
g_iterationss = group.iterations.list(state='opened')
45+
46+
Get a single iteration::
47+
48+
p_iteration = project.iterations.get(interation_id)
49+
g_iteration = group.iterations.get(interation_id)
50+
51+
Create a iteration::
52+
53+
iteration = project.iterations.create({'title': 'Week 22-23'})
54+
55+
Edit an interation::
56+
57+
iteration.description = 'v 1.0 release'
58+
iterations.save()
59+
60+
61+
List the issues related to a milestone::
62+
63+
issues = iteration.issues()

0 commit comments

Comments
 (0)