Skip to content

Commit

Permalink
Merge pull request #2022 from MichaelSweikata/feat/documentation-update
Browse files Browse the repository at this point in the history
docs: update issue example and extend API usage docs
  • Loading branch information
nejch committed May 23, 2022
2 parents 1e22790 + aad71d2 commit 792cee9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/api-usage.rst
Expand Up @@ -192,6 +192,17 @@ 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
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

0 comments on commit 792cee9

Please sign in to comment.