Email notification before closing issues


Currently we have a jelly script which will close tickets which are in resolved state for more than 30 days. as per configuration tickets will close automatically for tickets which are 30 days older. In between time.For resolved state tickets if users is not happy then he/she can re-open ticekts but not a closed ticekts they have to CLONE the ticket as new.

Here the requirement is Users(reporter) would like to know a notification email before closing ticket. Like one week before closing ticket they need get an automatic email saying that This tikcet in resoved state for 23 day for now. and will be closed in next 7 days.
Email should only receive by reporter only for his/her tickets.
Please advise how to achive this?

1 answer

1 accepted

0 votes
Accepted answer

Using Jelly to do this is a pretty standard approach, and as you've got the auto-close done that, you can do something similar with another script.

You might even be able to simply copy the one you've got, but with two changes - first, change the filter from "30 days" to "23 days" (i.e. they're going to expire in a week), then secondly, instead of the script closing the issues, it should just comment to say "it's getting old". (You might want to check that the current reporter is set up to get "issue commented" events)

Hi Nic,

I came to that level.

How do we code (jelly) to send email notification to reporter ? What chages to be done for below code?

My jelly script whcih i used for Auto closed for 30 days.

<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log" >
<jira:Login username="jiraadmin" password="xczxc">

<log:warn>Running Close issues service</log:warn>

<!-- Properties for the script -->

<core:set var="comment">


This ticket has been in resolved state for 30 days without an update.
This ticket will be automatically moved to closed state.
If this issue has not been resolved satisfactorily, clone this to a new ticket.

Thank you,
JIRA Administrator.

<core:set var="workflowStep" value="61" />
<core:set var="workflowUser" value="jiraadmin" />
<!-- Run the SearchRequestFilter -->
<jira:RunSearchRequest filterid="11240" var="issues" />
<core:forEach var="issue" items="${issues}">
<jira:TransitionWorkflow key="${issue.key}" user="${workflowUser}" comment="${comment}" workflowAction="${workflowStep}"/>

Help me in this regard.

The usual way to do it is already in there! The trick here is to set up the script so that it makes a comment on the issue (e.g. "This issue will be closed in a week") and make sure the notification scheme includes "email the assignee on comment".

You can use this script as a base - remove the stuff about moving through the workflow, and change the comment text.

You'll also need to do some stuff with filters. Your new script will need a new filter, which basically needs to say "status = resolved and updated < -23d"

The one you're using already for the "close issue" function (filter id 11240) will need to change because the new script will change the "issue updated" date on the issues. I think the easiest change is to make it work on a week rather than 30 days and then add the clause "and comments ~ "This issue will be closed in a week"" because then it will detect the issues the first script commented on and ignore ones that it has not commented on.

Hi Brough, When we make comments through jelly script. Email notification will go to all the persons which listed for that tikcet. like Reporter, Assignee, Watchers list, and custom groups.

Here my requirement is just to notify "Reporter" only.

I am bit new to jelly script. Please help, if possible let me know the sample code.

Thanks in advance.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,816 views 18 22
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you