Create, Retrieve, Update and Delete Notifications

This page contains the REST Endpoints enabling you to create, retrieve, update and delete notifications.

Request URI

Createhttps://your.base.url/rest/announcer/1.0/admin/notifications

Retrievehttps://your.base.url/rest/announcer/1.0/admin/notifications

Updatehttps://your.base.url/rest/announcer/1.0/admin/notifications/{id}

Deletehttps://your.base.url/rest/announcer/1.0/admin/notifications/{id}


Parameters

Parameter Name

Value

Description

Parameter Name

Value

Description

title

String

Title of the notification

description

string

Notification description

contents

string

Notification contents

type

string

Any of the "dialog", "flag","banner", "intercept" types

displayType

string

"0" for None

"1" for Warning

"2" for Information

"3" for Error

format

string

"0" for HTML

"1" for plain text

"2" for Markdown

isActive

string

"true" for active/enable

"false" for inactive/disable

showButton

string

"true" to display the Acknowledge button, "false" to hide

buttonText

string

Text on button that users see when acknowledging notifications

delayButton

string

"true" to wait for 5 seconds before acknowledging the notification

anonymous

string

"true" to display the notification to anonymous users

filterGroups

string

"true" to filter the notifications to specific groups (mandatory for filtering groups to apply)

targetGroup

string

comma-separated groups:

  • if filtering for a single group, use under "jira-administrators"

  • if filtering for multiple groups, use under (comma-separated)
    "jira-administrators,jira-users,jira-servicedesk-admins"

filterProjects

Boolean

Set to true to enable filtering notifications to specific projects.

If set to true, the targetProject parameter must also be provided.

targetProject

Array of Strings

An array containing the keys of the target projects for filtering notifications.

If the array is empty, then filterProjects will be considered false.

Example: [“TEST”, “APP”]

recurrence

Object

An object that holds dateRestrict parameters for defining the recurrence of notifications.

Please check this document for more details on recurrence configuration.

filterUser

Boolean

Set to true to enable filtering notifications to specific users.

If set to true, the targetUser parameter must also be provided.

targetUser

Array of Strings

An array containing the usernames of the target users for filtering notifications.

If the array is empty, then filterUser will be considered false.

Example: [“admin”, “user1”]

Create Notifications

Sample request

curl -X POST http://localhost:2990/jira/rest/announcer/1.0/admin/notifications \ -H "Content-Type: application/json" \ -d '[{"title":"Dialog","description":"desc1","contents":"xxx","type":"dialog","displayType":"0","showButton":"true","isActive":"true", "format":"1"}, {"title":"Banner","description":"desc2","contents":"yyy","type":"banner","displayType":"1","showButton":"true","isActive":"true","format":"1"}, {"title":"Intercept","description":"desc2","contents":"yyy","type":"intercept","displayType":"2","showButton":"true","isActive":"true","format":"1"}]' \ --user "admin:admin"

Sample request to target the notifications to specific group

curl -X POST http://localhost:2990/jira/rest/announcer/1.0/admin/notifications \ -H "Content-Type: application/json" \ -d '[{"title":"Sample Title","description":"This is sample","contents":"content goes here","type":"dialog","displayType":"0","showButton":"true","isActive":"true", "format":"1","filterGroups":"true","targetGroup":"jira-administrators"}, {"title":"Banner","description":"desc2","contents":"yyy","type":"banner","displayType":"1","showButton":"true","isActive":"true","format":"1"}, {"title":"Intercept","description":"desc2","contents":"yyy","type":"intercept","displayType":"2","showButton":"true","isActive":"true","format":"1","filterGroups":"true","targetGroup":"jira-administrators,jira-users,custom-group"}]' \ --user "admin:admin"

Sample request to target the notifications to specific project

curl -X POST http://localhost:2990/jira/rest/announcer/1.0/admin/notifications \ -H "Content-Type: application/json" \ -d '[{"title":"Sample Title","description":"This is sample","contents":"content goes here","type":"dialog","displayType":"0","showButton":"true","isActive":"true", "format":"1","filterProjects":"true","targetProject": ["TEST"]}, {"title":"Banner","description":"desc2","contents":"yyy","type":"banner","displayType":"1","showButton":"true","isActive":"true","format":"1"}, {"title":"Intercept","description":"desc2","contents":"yyy","type":"intercept","displayType":"2","showButton":"true","isActive":"true","format":"1","filterProjects":"true","targetProject": ["DEV", "QA", "HR", "ADMIN"]' \ --user "admin:admin"

Retrieve Notifications

Sample Request

Update Notifications

Sample request

Delete Notifications

Sample request


Need more help? Contact our support team.