Notifications to users in multiple projects

Lakshmi S March 4, 2021

Hi Team,

Could you please suggest how to implement this ?

On a given project = Change Management BI Implementation (CHGIMPBI), with ABC component, reported by XYZ resource
if XYZ try to transition this ticket to "waiting for approval", can we add a trigger to let XYZ notified along with BBB who is the assignee to a ticket  with  BI Implementation (BIIMPL) project with "in progress" status and the ABC component?

We have script runner, JMWE, JSU , addons, we are on v8.13.3.

Thanks!

1 answer

0 votes
Leo
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 11, 2021

Hi @Lakshmi S,

I believe you can do that with scriptrunner's postfunction

If I understood correctly

if(currentuser == xyz/reporter){

  assignee = assignee of 2nd project issue

  sendmail to assignee& reporter/xyz

 

below is the snippet I used with a project to send custom mail

if(isThere){
ApplicationUser user = userManager.getUserByName("kagovin2")
watcherManager.startWatching(user, issue)
def emailBody = "body "
sendEmail("mail1, mail2", "some text", emailBody)
}

def sendEmail(String emailAddr, String subject, String body) {
SMTPMailServer mailServer = ComponentAccessor.getMailServerManager().getDefaultSMTPMailServer()
if (mailServer) {
Email email = new Email(emailAddr)
email.setSubject(subject)
email.setBody(body)
mailServer.send(email)
log.warn("Mail sent")
} else {
log.warn("Please make sure that a valid mailServer is configured")
}
}

 

BR,

Leo

Suggest an answer

Log in or Sign up to answer