Email notification before closing issues

VenugopalY October 20, 2013

Hello,

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
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 20, 2013

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)

VenugopalY October 21, 2013

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

Hello,

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>
<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}"/>
</core:forEach>
</jira:Login>
</JiraJelly>

Help me in this regard.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 21, 2013

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.

VenugopalY October 22, 2013

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