Skip to content

doc: API Doc Updates #2025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/api-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ You can print a Gitlab Object. For example:
# Or explicitly via `pformat()`. This is equivalent to the above.
print(project.pformat())

You can also extend the object if the parameter isn't explicitly listed. For example,
if you want to update a field that has been newly introduced to the Gitlab API, setting
the value on the object is accepted:

.. code-block:: python

issues = project.issues.list(state='opened')
for issue in issues:
issue.my_super_awesome_feature_flag = "random_value"
issue.save()

Base types
==========
Expand Down
11 changes: 11 additions & 0 deletions docs/gl_objects/issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ Delete an issue (admin or project owner only)::
# pr
issue.delete()

Assign the issues::

issue = gl.issues.list()[0]
issue.assignee_ids = [25, 10, 31, 12]
issue.save()

.. note::
The Gitlab API explicitly references that the `assignee_id` field is deprecated,
so using a list of user IDs for `assignee_ids` is how to assign an issue to a user(s).


Subscribe / unsubscribe from an issue::

issue.subscribe()
Expand Down