...
...
- Go to right corner Cog → JIRA Administration → Issue → Workflows. Edit the workflow of the project you want to add the Post Function

- Click on the transition you want to change and select the Post Functions tab. Click on Add post function

- Select Send Slack Notification by JEMHCloud and click Add

- Set the Slack Connection, Chanel and Velocity script if necessary. Press Add/Update

- Move the Post Function to last position and publish the workflow draft.

- Remember to publish the workflow change draft!
- To test the post function, go to an issue and perform the transition.

- Post function event should appear in JEMH Cloud → Notifications → Events.

- The event report:

- The message in Slack Message:

- In Auditing → Outbound Messages, the table should show the SMS SLACK messages sent and the cog icon should show their contents.

Image Removed
Image Added
Filter Scripts
Both SMS notification mapping and SMS post function Slack Notification Mapping and Slack Post Function behavior can be changed at runtime with a Velocity Script. The script can use the event data or be time based to change how notifications are performed.
Reset/Add Phone Numbers
Code Block |
---|
title | Change to phone number channel when Critical |
---|
|
#if ($context.issue.fields.priority.name.textValue() != 'Critical')
$smsNotificationUtils$slackNotificationUtils.resetToPhoneNumberssetChannel('AnotherChannelNameOrId') ## ExcludeJEMHC thelooks configuredfor phonethe numberschannel inby theeither mappingname or post function**
$smsNotificationUtils.addToPhoneNumber("+1234567") ## Sets the only phone number for critical issues. **
id
#end |
Restrict notifications to specific time ranges
Code Block |
---|
title | Notify only after hours |
---|
|
#if (!$dateTimeUtils.betweenHours("18:00", "06:00"))
$smsNotificationUtils$slackNotificationUtils.inhibitNotification() ## SMSsSlack messages are not sent during business hours **
#end |
...
No Format |
---|
#if ($context.issue.fields.priority.name.textValue() != 'Blocker')
$smsNotificationUtils$slackNotificationUtils.inhibitNotification()
#end |
...
Warning |
---|
Velocity Script cannot be validated at configuration time (for example the dynamic phone numberschannel). You should test the script by re-executing events in Auditing → Events |
...