I need to have Jira send an email to our helpdesk system when a field is checked (like a custom checkbox field). For example the field "need helpdesk ticket". When this field is checked I want Jira to file an email to a specific email address (not assignee or reporter).
Is that possible?
Thanks
Yes. Write an Event Listener which scans for the checkbox CF during creation, which can then do what you want.
Take a look at https://studio.plugins.atlassian.com/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Sendacustomemail - use it as a listener, then for you condition you can do "cfValues["MyCheckBox"]"
You don't need to write any code...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From the "public void issueUpdated(IssueEvent event) {"
Check if the check box is selected, then call some code for sending the mail.
Here is a part of the code we used for sending mail:
(Recipients can also be other that the assignee or reporter)
private void sendEmail(IssueEvent event, Issue issue, String emailUser ) {
if (issue != null) {
Long templateId = ComponentManager.getInstance().getEventTypeManager().getEventType(event.getEventTypeId()).getTemplateId();
Set<NotificationRecipient> recipientList = new HashSet<NotificationRecipient>();
if (emailUser == ASSIGNEE) {
recipientList.add(new NotificationRecipient(issue.getAssigneeUser()));
} else if (emailUser == REPORTER) {
recipientList.add(new NotificationRecipient(issue.getReporterUser()));
}
String notificationType = "Sub-Task";
DefaultIssueMailQueueItemFactory dimqItemFactory = (DefaultIssueMailQueueItemFactory) ComponentManager.getComponentInstanceOfType(com.atlassian.jira.mail.DefaultIssueMailQueueItemFactory.class);
IssueMailQueueItem issueItem = dimqItemFactory.getIssueMailQueueItem(event, templateId, recipientList, notificationType);
issueItem.setMailThreader(null);
MailQueueAdmin mailQueueAdmin = new MailQueueAdmin();
mailQueueAdmin.getMailQueue().addItem(issueItem);
}
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.