Enable or Disable Email Notifications for an Individual

Coverity on Polaris

Version
latest
Email notifications is a feature on Coverity on Polaris for sending emails when events occur in the system. For individuals, you can turn email notifications on or off by changing the user-project configuration.

About Email Notifications

Currently, there are two email notification types:

  • Successful scan. When a project is scanned successfully and has the latest results available to view on Coverity on Polaris.
  • Job failure. When an attempt to run a tool either doesn't complete or doesn't produce the intended output.

About Configuration Scopes

Notifications can be enabled or disabled at three scope levels.

  • Organization: Enables or disables the notifications feature across all projects owned by the organization. If enabled, project level configuration is applied.
  • Project: Enables or disables notifications for this project. Only applied if organization level notifications are enabled. If enabled, user-project level configuration is applied.
  • User-Project: Enables or disables notifications for a particular user and only for one project. Only applied if organization and project notifications are enabled.

When notifications are disabled at a higher level of scope, it applies to all scope levels below. For example, disabling at the organization level disables all projects and their users; disabling a single project will disable any notifications for users within that project but not other projects.

Email notifications at the organization and project levels are enabled by default. The user-project level is disabled by default.

To enable or disable notifications for an individual user on a project:

Request:


    POST https://subdomain.cop.blackduck.com/api/notifications/v0/user-project-configs                                  

    {
       "data": {
       "type": "user-project-config",
         "attributes": {
         "user-id": "m830ovrhil4onbcolvag8j54qo",
         "project-id": "50640e83-6b5b-4dba-982d-c6b461227580",
         "enabled": false
         }
       }
    }
                     
                     
                    

This example updates the state of data.attributes.enabled to false, which disables email notifications for the specified user and project. The user and project are identified by data.attributes.user-id and data.attributes.project-id.

Response:


{
    "data": {
        "id": "87995850-e7e8-4d0f-a0b5-18ee5094b65e",
        "type": "user-project-config",
        "attributes": {
            "user-id": "m830ovrhil4onbcolvag8j54qo",
            "parent-scope-enabled": false,
            "project-id": "50640e83-6b5b-4dba-982d-c6b461227580",
            "enabled": false
            },
        "links": {
            "self": "https://subdomain.cop.blackduck.com/api/notifications/v0/user-project-configs/87995850-e7e8-4d0f-a0b5-18ee5094b65e"
        }
    }
}