Hi,
there is a requirement to send an email for issue created updated and all the events related to it to multiple non jira user group emails for a particular project. can someone try to help as quickly as possible. Our instance is Jira Data center. I found few pages to see if we can use listener but as I'm not familiar with the script could not apply it.
Regards,
CS Satchidanand
Of course, you can use script with listener, but if you don't have experience in scripting, maybe it's better to use Jira Automation?
Jira DC has Automation by default.
Hi @Evgenii appreciate your help I have tried this automation before as well it says successfully sent email but there is nothing received in the mail box
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, if you want, I can give you script for sending emails, but Automation is a good tool too and it's worth to fix it.
I'd check email queues in Jira, to see, if letter appear there, when rule triggers, and of course it's a good idea to check spam folder in mailbox. I often use this functionality, to send letters to gmail mailbox and letters deliver successfully.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
email queues im seeing it empty none in email queue or error queue. any setting im missing to check for configuring
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The easiest from UI is:
Open email queue in one window, and in another window - run action, to trigger sending email. After that refresh window with email queue. There must appear new email, which is waiting to be send.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As I promised, example code to send emails. It can be run from console or listener:
/*
* Created 2023.
* @author Evgeniy Isaenkov
* @github https://github.com/Udjin79/SRUtils
*/
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.mail.Email
import com.atlassian.mail.queue.SingleMailQueueItem
String emailAddr = "your_mailbox@gmail.com"
String subject = "TEST letter"
String body = "TEST email body"
Email email = new Email(emailAddr)
email.setSubject(subject)
email.setBody(body)
email.setMimeType('text/html; charset=utf-8')
SingleMailQueueItem smqi = new SingleMailQueueItem(email)
ComponentAccessor.getMailQueue().addItem(smqi)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see this happening but still no email incoming to the mail box
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If your company use your own mail server, ask your mail administrator to check mail logs, to see, what happens with sent emails.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am all set but what should I mention in order to get the details for example
Subject: Issue Key was Just created or updated
Content:
If it should be mentioned event-wise
summary of the ticket/comments updated/issue fields. how to place smart values so that it can take it from the ticket
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Clarify please, you're talking about automation rule or script?
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.
Ok, understood. You can use next Smart Values for getting summary or changes, for example:
{{issue.description}} - issue description
{{issue.summary}} - issue summary
{{issue.key}} - issue key
// Summary changes
{{#changelog.summary}}
{{toString}}
{{/}}
// Previous status name
{{#changelog.status}}{{fromString}}{{/}}
If you want to show event type, you can use:
{{eventType}}
Also, event type Smart Value can be used for managing rule conditions.
More information can be found here:
https://confluence.atlassian.com/automation/smart-values-in-jira-automation-993924627.html
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.