SMS notification via scriprunner

Valeriya Kozak February 13, 2019

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

 

1 answer

0 votes
Rano April 26, 2021

Hello) have you found a solution to implement this functionality?

Suggest an answer

Log in or Sign up to answer