GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python-gitlab/docs/gl_objects/notifications.rst at master · classicvalues/python-gitlab

Expand file tree

/

notifications.rst

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
59 lines (45 loc) · 1.79 KB
/

notifications.rst

Copy path

File metadata and controls

59 lines (45 loc) · 1.79 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Notification settings

You can define notification settings globally, for groups and for projects. Valid levels are defined as constants:

  • gitlab.NOTIFICATION_LEVEL_DISABLED
  • gitlab.NOTIFICATION_LEVEL_PARTICIPATING
  • gitlab.NOTIFICATION_LEVEL_WATCH
  • gitlab.NOTIFICATION_LEVEL_GLOBAL
  • gitlab.NOTIFICATION_LEVEL_MENTION
  • gitlab.NOTIFICATION_LEVEL_CUSTOM

You get access to fine-grained settings if you use the NOTIFICATION_LEVEL_CUSTOM level.

Reference

  • v4 API:
    • :class:`gitlab.v4.objects.NotificationSettings`
    • :class:`gitlab.v4.objects.NotificationSettingsManager`
    • :attr:`gitlab.Gitlab.notificationsettings`
    • :class:`gitlab.v4.objects.GroupNotificationSettings`
    • :class:`gitlab.v4.objects.GroupNotificationSettingsManager`
    • :attr:`gitlab.v4.objects.Group.notificationsettings`
    • :class:`gitlab.v4.objects.ProjectNotificationSettings`
    • :class:`gitlab.v4.objects.ProjectNotificationSettingsManager`
    • :attr:`gitlab.v4.objects.Project.notificationsettings`
  • GitLab API: https://docs.gitlab.com/ce/api/notification_settings.html

Examples

Get the notifications settings:

# global settings
settings = gl.notificationsettings.get()
# for a group
settings = gl.groups.get(group_id).notificationsettings.get()
# for a project
settings = gl.projects.get(project_id).notificationsettings.get()

Update the notifications settings:

# use a predefined level
settings.level = gitlab.NOTIFICATION_LEVEL_WATCH

# create a custom setup
settings.level = gitlab.NOTIFICATION_LEVEL_CUSTOM
settings.save()  # will create additional attributes, but not mandatory

settings.new_merge_request = True
settings.new_issue = True
settings.new_note = True
settings.save()
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.