Hello
Is there a way to have a conditional merge check script which would check if variable X defined in the committed application.properties file is equal to its counterpart variable X' in the master application.properties file.
Hi @[deleted] , I didn't test it but IssueLinkCreatedEvent object has method getIssueLink . It returs a com.atlassian.jira.issue.link.IssueLink object and it contains reference to the source and destination issues (getSourceObject(), getDestinationObject()).
So you can get watchers from the linked issues.
The issueLinkCreatedEvent won't have an issue object to act on. So the built-in Send Email script won't know which email to send email to.
Your options are either, use the custom scripted listener to send the email:
import com.atlassian.mail.server.SMTPMailServer
import com.atlassian.mail.server.MailServerManager
import com.atlassian.mail.Email
import com.atlassian.mail.MailException
import com.atlassian.mail.MailFactory
import com.atlassian.mail.queue.SingleMailQueueItem
import com.atlassian.jira.component.ComponentAccessor
def recipients = 'xxx@yyy'
def subject = 'whatever subject you want'
def body = 'contruct your own body'
def plain = true //or false if you want to include html in body
def mailServerManager = ComponentAccessor.mailServerManager
def mailServer = mailServerManager.defaultSMTPMailServer
if (mailServer && !MailFactory.settings.sendingDisabled) {
def email = new Email(recipients)
email.setFrom(mailServer.defaultFrom)
email.setSubject(subject)
if(plain) {
email.setMimeType("text/plain")
} else {
email.setMimeType("text/html")
}
email.setBody(msgBody)
try {
def item = new SingleMailQueueItem(email);
ComponentAccessor.getMailQueue().addItem(item);
Date today = new Date()
return "Success"
} catch (MailException e) {
log.error e.message
}
} else {
log.warn "Sending is disabled"
}
Or, as you suggested, use the custom listener to fire a new event using the isseEventManager
import com.atlassian.jira.component.ComponentAccessor
def issueEventManager = ComponentAccessor.issueEventManager
issueEventManager.dispatchEvent(eventId,issue, user,false)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.