Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Notifications to users in multiple projects

Lakshmi CH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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 Champion
March 11, 2021

Hi @Lakshmi CH,

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