Skip to content

Commit 792cee9

Browse files
authored
Merge pull request #2022 from MichaelSweikata/feat/documentation-update
docs: update issue example and extend API usage docs
2 parents 1e22790 + aad71d2 commit 792cee9

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy