8000 docs: update issue example and extend API usage docs · resmo/python-gitlab@aad71d2 · GitHub
[go: up one dir, main page]

Skip to content

Commit aad71d2

Browse files
msweikatacoconejch
authored andcommitted
docs: update issue example and extend API usage docs
1 parent fd9154e commit aad71d2

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

docs/api-usage.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,17 @@ You can print a Gitlab Object. For example:
192192
# Or explicitly via `pformat()`. This is equivalent to the above.
193193
print(project.pformat())
194194
195+
You can also extend the object if the parameter isn't explicitly listed. For example,
196+
if you want to update a field that has been newly introduced to the Gitlab API, setting
197+
the value on the object is accepted:
198+
199+
.. code-block:: python
200+
201+
issues = project.issues.list(state='opened')
202+
for issue in issues:
203+
issue.my_super_awesome_feature_flag = "random_value"
204+
issue.save()
205+
195206
196207
Base types
197208
==========

docs/gl_objects/issues.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ Delete an issue (admin or project owner only)::
133133
# pr
134134
issue.delete()
135135

136+
137+
Assign the issues::
138+
139+
issue = gl.issues.list()[0]
140+
issue.assignee_ids = [25, 10, 31, 12]
141+
issue.save()
142+
143+
.. note::
144+
The Gitlab API explicitly references that the `assignee_id` field is deprecated,
145+
so using a list of user IDs for `assignee_ids` is how to assign an issue to a user(s).
146+
136147
Subscribe / unsubscribe from an issue::
137148

138149
issue.subscribe()

0 commit comments

Comments
 (0)
0