Versions Compared

Key

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

...

Send SMS notifications from issue events

Like Email or HipChat Notification MappingMappings, the SMS notification mapping is in charge of sending SMS messages from Issue events through the SMS Transport.

...

  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 SMS Notification by JEMHCloud and click Add
  4. Set the SMS Transport, to phone numbers (CSV) 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. In Auditing → Outbound Messages, the table should show the SMS messages sent and the cog icon should show their contents.

...

Scripting

Both SMS notification mapping and SMS post function behavior behaviour can be changed at runtime with a user-defined Velocity Script. The script can use the event data or be time based to change how notifications are performed.

...

Code Block
titleChange to phone number when Critical
#if ($context.issue.fields.priority.name.textValue() != 'Critical') ## if issue priority is critical
  $smsNotificationUtils.resetToPhoneNumbers() ## Excluderemove the configuredexisting phone numbers infor thecurrent mappingnotification
or post function**
  $smsNotificationUtils.addToPhoneNumber("+1234567") ## Sets theadd only phone number forto critical issues. **current notification
#end

Restrict notifications to specific time ranges

Code Block
titleNotify only after hours
#if (!$dateTimeUtils.betweenHours("18:00", "06:00")) ## during specific hours
   $smsNotificationUtils.inhibitNotification() ## SMSsprevent arecurrent notSMS sent during business hours **
notification
#end

Restrict by priority

No Format
#if ($context.issue.fields.priority.name.textValue() != 'Blocker') ## if issue priority is not a blocker
   $smsNotificationUtils.inhibitNotification() ## prevent current SMS notification
#end


Warning

Velocity Script cannot be validated at configuration time (for example the dynamic phone numbers). You should test the script by re-executing events in Auditing → Events

...