Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,054
Community Members
 
Community Events
176
Community Groups

Create job on JIRA for daily email reminder

Edited

Hi,

Is it possible to create a custom job on JIRA to send a daily email reminder?

I have looked into adding a post-function once an issue moves to the status but this would just be a once off email reminder. 

We cannot add add-ons to our instance so 3rd party apps do not work and automation on server does not seem to cater for this.

I have this script that could work and run as a daily job based on the JQL query of when those tickets are in the specific status. 

The JQL query is as follows: "project = XXXXXX AND status = "Line Manager Approval"

The only thing is the email to be sent is to different people.
The names of the people who the email is sent to is under a custom field called "Requestors Approving Manager/Executive" on the issues.

This custom field is configured as follows :
User Filtering:
Filtering users by the following:
Project Role: Approvers

How do I edit the below script to include the above information and send the email to the right people?

import com.atlassian.mail.Email;
import com.atlassian.mail.server.MailServerManager;
import com.atlassian.mail.server.SMTPMailServer;
import com.atlassian.jira.component.ComponentAccessor;
 
def subject = "Manager Approval for ${issue.key}"
def body = "Hi ${issue.assignee.displayName} \n\nReminder for approval for the following issue: {issue.key} - ${issue.summary}. \n\n"
def emailAddr = issue.getAssignee().getEmailAddress() //this is where I am having trouble configuring for the custom field email address
 
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);
} else {
// Problem getting the mail server from JIRA configuration, log this error
}
}
 
sendEmail (emailAddr, subject, body)

2 answers

1 accepted

0 votes
Answer accepted

Hi @Drishti Maharaj ,

 

Can you provide more details of your requirement. 

 

Regarding sending daily reminder, have you tried to filter subscription ?

 

More details of subscription @ 

https://confluence.atlassian.com/jiracoreserver085/working-with-search-results-981157534.html#Workingwithsearchresults-subscribeSubscribingtoyoursearchresults

Hi @Sreenivasaraju P , yes we have tried that but the user who need to receive the email reminders do want that method. 

Hence I am trying to find another solution.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events