In our issue, I set several datetime field, for example KeyMilestone Date1, KeyMilestone Date2, KeyMilestone Date3 and KeyMilestone Date4.
I want to send mail to project role "JM" when today's date reaches the value in above datetime custom fields.
Can anyone help me?
Hi Clair
Keeping in mind that issues are not aware of date changes. This doesn't generate any workflow or issue event.
So your solution will be based on some sort of scheduling mechanism.
Your first option (no scriptrunner needed) is with a few saved filter/subsriptions. https://confluence.atlassian.com/jiracoreserver/constructing-cron-expressions-for-a-filter-subscription-939937790.html
The probelm with that is that you can't set a project role as the recipient. You can only use a jira group. But you could set the subscription to a large group and then retric the notificaiton using clever JQL.
project in porojectWhereUserHasRole("JM") and "KeyMilestone Date1" > -1d
This will return all the issues where the keyMilstone Date1 is within 1day of the current date and will be filtered for the current user being a member of the JM role. Then when you create a subscription and assign it to jira-users or some other large role, only users of the role will receive the list of matching ticket. Repeat for each milestone and define the timing of the subscription.
The other option, with scriptrunner, is to use the escalation service where you can define both the JQL to identify which tickets to act on and the interval to run it daily. But this would require you finding a way to trigger the emailing part yourself. You could do this by triggering a workflow transition, then in that transition, add a scriptrunner post function to "Send a custom email". Another way would be to use some scripting to fire a custom event, and have a scriptrunner listener watch for that event and use the Send a custom email built-in script
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.