Web-Push-Messages


Users who have allowed web push notifications in Quick Settings can send messages from any script:

To do this, the “Accept messages” option must be activated:

image-20250207074309-2.png

Send a push notification to a single user by copying and customizing the following line in your script:

helper.notifyUser(231, "Neues Ticket", "Bitte prüfen", "User-231");

The method helper.notifyUser(Long userId, String title, String message, String topic) takes the following parameters:

  • userId: The ID of the recipient (see user list)
  • title: Title of the message
  • message: The message body (plain text)
  • topic: The topic of the message. This is not displayed to the recipient, but you can overwrite messages with the same topic by resending and thus avoid the user seeing too many messages in a list.

The method notifyWorkGroup(Long workgroupId, String title, String message, String topic) works similarly, but here the message is sent to all active members of a team - provided they have allowed it to be received). Accordingly, the ID of a group is specified here as the first parameter:

helper.notifyWorkGroup(110, "Neues Ticket an Team Messe", "Bitte bearbeiten, "Messe");

Message about a ticket

If you want to alert an employee or all members of a team to a specific ticket, use the following methods. By passing the ticket ID as the last parameter, users have the opportunity to display the relevant ticket directly from the message with one click:

 Typically, the message relates to the ticket that is currently being processed in the script in question. In this respect, the following line will have the desired effect when called with task.id:

helper.notifyUserTicket(231, "Neues Ticket", "Bitte prüfen", "Ticket", task.id);

If you want to notify all members of a team in the same way, use the following code. The addressed team of the current ticket is taken as the team ID (if the ticket was addressed to a group). The title of the ticket is also included directly in the message:

if(task.getAddressedWorkgroupId())
    helper.notifyWorkgroupTicket(task.getAddressedWorkgroupId(),
    ,"New Ticket", task.title, "Ticket", task.id);

On a message recipient's PC, the message might look something like this:

image-20250131140453-2.png

By clicking on “Show Ticket” a new browser window will open and the ticket in question will be displayed immediately.