Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
  • Community
  • Answers Developer Questions
  • Questions
  • I need a Jelly script to send reminder emails to set the due date, when the issue created is 2 or more weeks old. During the first week of running Jelly script, emails should be sent to just the reporter. If the reporter has not set the due date during t

I need a Jelly script to send reminder emails to set the due date, when the issue created is 2 or more weeks old. During the first week of running Jelly script, emails should be sent to just the reporter. If the reporter has not set the due date during t

Vishali
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.
August 3, 2012

I need a Jelly script to send reminder emails to set the due date, when the issue created is 2 weeks old. During the first week of running Jelly script, emials should be sent to just the reporter.

If the reporter has not set the due date during that week, then emails should be sent to Assignee as well, from second week. Could any of you please help with this script?

Filter in Jira: project = JIRA AND created <= -2w AND duedate = EMPTY AND status not in (Closed, Dissapproved, "On Hold")

I have created a jelly script like this:

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


<core:invokeStatic className="com.atlassian.jira.ComponentManager" method="getInstance" var="componentManager"/>
<core:invoke on="${componentManager}" method="getProjectManager" var="projectManager"/>

<!-- Run the SearchRequestFilter -->
<jira:RunSearchRequest filterid="10611" var="issues" />

<!-- For each of the filtered issues -->
<core:forEach var="issue" items="${issues}">
<log:warn>Sending reminder to set due date for issue ${issue.key}</log:warn>
<core:invoke on="${projectManager}" method="getProject" var="project">
<core:arg type="java.lang.Long" value="${issue.project}"/>
</core:invoke>

<email:email server="xxxx-exchange.xxxx.com" from="jira@xxxx.com"
to="${issue.reporter}@xxxx.com" subject="[JIRA] Reminder to set Due Date for ${issue.key}">
[https://services.xxxx.com:8443/browse/${issue.key}?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

<b> REMINDER: Please set a Due Date for ${issue.key}</b>
-----------------------------------------------------------------------

Issue Summary: ${issue.summary}
Key: ${issue.key}
URL: https://services.xxxx:8443/browse/${issue.key}
Project: ${project.name}
Reporter: ${issue.reporter}
Assignee: ${issue.assignee}

Thank you,
Jira Administrators

</email:email>
</core:forEach>
</jira:Login>
</JiraJelly>

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Vishali
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.
October 3, 2012

I have created two seperate filters (one for first week and the other for second week) and two seperate Jelly scripts.

Michael Roff
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.
October 23, 2012

Hi Vishali,

I am looking to do a very similar thing but am having trouble getting it to work on JIRA 5.

Are you running JIRA 5?

If so, would you mind sharing the scripts you are using? I would be most appreciative.

Thanks, Michael

Vishali
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.
October 23, 2012

Yes, I am working on Jira 5. Sure, I would. Can you send me your mail id?

Michael Roff
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.
October 24, 2012
Mario February 5, 2015

@Vishali Hi Vishali Please help me too, would you mind sharing the scripts you are using with me? Thanks in advance

0 votes
CCP TechOps January 16, 2015

Rajani Balla,

 

 If you don't mind Can you share the script with us or post here it self, also i don't want to stick on "to="${issue.reporter}@xxxx.com" for specific domain is there any way to get this reporter email automated to the to address, i have user from many domain. and running on Jira 6.2.7

 

0 votes
B_ Normann P_ Nielsen
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 17, 2013

Picking up on this, I am using the same code - more or less, like:

<core:invoke on="${projectManager}" method="getProject" var="project" />

<core:arg type="java.lang.Long" value="${issue.project}"/>

<core:invoke>

This fails with:
Exception: org.apache.commons.jelly.JellyTagException: file:/pack/jira-jelly/CWF-2-Notification.xml:42:0: No such accessible method: getProject() on object: com.atlassian.jira.project.CachingProjectManager
Can U help me? REferring to http://docs.atlassian.com/jira/latest/com/atlassian/jira/project/ProjectManager.html#getProjectObj(java.lang.Long) it should be possible ( the getProject is deprceted, but getProjectObj fails similar)
BR,
Normann

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events