Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourYellow
titleDRAFT

...

Status
colourYellow
titleIN DEV

Table of Content Zone

Table of Contents

...

  1. Go to right corner Cog → JIRA Administration → Issue → Workflows. Edit the workflow of the project you want to add the Post Function
  2. Click on the transition you want to change and select the Post Functions tab. Click on Add post function
  3. Select Send Slack Notification by JEMHCloud and click Add
  4. Set the Slack Connection, Chanel and Velocity script if necessary. Press Add/Update
  5. Move the Post Function to last position and publish the workflow draft.
  6. Remember to publish the workflow change draft! 
  7. To test the post function, go to an issue and perform the transition.
  8. Post function event should appear in JEMH Cloud → Notifications → Events.
  9. The event report:
  10. The message in Slack Message:
  11. In Auditing → Outbound Messages, the table should show the SMS SLACK messages sent and the cog icon should show their contents.

    Image RemovedImage 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
titleChange 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
titleNotify 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

...