Hi,
I am new to script runner and need to configure SMS notifications when a user creates a bug with 1 or 2 severity. I found the below-mentioned script in the community for email notifications. Can someone help me to rewrite it for SMS notifications?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.project.VersionCreateEvent
import com.atlassian.jira.event.project.VersionUpdatedEvent
import com.atlassian.mail.Email
import com.atlassian.mail.queue.SingleMailQueueItem
def email = new Email("some@example.com")
if (event instanceof VersionUpdatedEvent){
def event = event as VersionUpdatedEvent
email.setSubject("Version updated")
email.setBody("Version release date: ${event.version.releaseDate}")
// email.setMimeType("text/html") // for messages with an html body
SingleMailQueueItem item = new SingleMailQueueItem(email)
ComponentAccessor.getMailQueue().addItem(item)
}
else if (event instanceof VersionCreateEvent){
def event = event as VersionCreateEvent
email.setSubject("Version created")
email.setBody("Version release date: ${event.version.releaseDate}")
// email.setMimeType("text/html") // for messages with an html body
SingleMailQueueItem item = new SingleMailQueueItem(email)
ComponentAccessor.getMailQueue().addItem(item)
}
I know that there are plug-ins available on the market for sending SMS, but I need to do it via script runner
Will highly appreciate any help/guidance.
Thank you!
Valeriya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.