Forums

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

Can jira fire up an email to a specific email address via check box checked

Nariman Riahi
Contributor
October 11, 2011

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

3 answers

1 accepted

1 vote
Answer accepted
Deleted user October 11, 2011

Yes. Write an Event Listener which scans for the checkbox CF during creation, which can then do what you want.

0 votes
JamieA
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.
February 23, 2012

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...

0 votes
Stein Jakob Modalsli
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 23, 2012

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);
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events