Hi,
I have created an automation. The automation goes like this. When sprint is about to close in next two days, an email should be sent to all the team members whose user stories are still not complete. So, need to remind them saying, 'Hey guys, you need to close the stories, before the sprint ends.
For this I have created below automation. As you can see, JQL query is executed successfully, but NO email is sent to my mail IS with a details of user stories which are currently in 'Non-Done' status. Can you please help me with this?
You can see the 'Audit Log' as well.
Hi @Vijay Kumar -- Welcome to the Atlassian Community!
Do you have the bulk-handling option selected for your rule's trigger? https://confluence.atlassian.com/automation/run-a-rule-against-issues-in-bulk-993924653.html
If not, your rule will, iterate over multiple issues (potentially sending multiple emails)
And, if the issues have ever been in multiple sprints, the advanced compare condition will not work. The reason the condition will not work is the Sprint field is a list of values, and so {{sprint.endDate}} is a list of values, preventing the diff() function from working.
To do what you described as the need, the rule's trigger should use the bulk-handling option and the rule should use the plural {{issues}} smart value.
Then assuming your open / active sprint is the latest one, the date needed for the comparison would be:
{{issues.first.sprint.endDate.max}}
Then your email could again use the {{issues}} smart value to iterate over them for the notification:
{{#issues}}
* {{key}} -- {{summary}} -- {{assignee.displayName}}
{{/}}
Kind regards,
Bill
Hi Bill,
Thanks much for the reply. I think I have bulk-handling option selected. Please see below and correct me if I am wrong.
Also, at any point in time, we will have only one active sprint. That is two-week sprint. Issues are moved from one sprint to the other, if team was not able to complete the story in the current sprint.
Other components and values given for those are as below,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In that case, please test your rule and let us know if it is working as expected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, it's not working. As I see, JQL is validated, looks like condition is not meeting. Again, it's just a wild guess. Or it could be something else. Don't know. Very confused.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The image you show of the advanced compare is trying to compare a date value to 4. The smart value I provided was what to use with the diff() function, not the entire expression. Please update your condition to:
Then re-test your rule.
If that does not work, please post the following with images large enough to view the details:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried with this option. But no luck. Here you go for all the details about Rule.
Scheduler Details
Advanced Compare Condition
Send email component
Log Action:
Audit Log
Rule Details Section
Automation Sequence:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that information, and it appears the nested list-within-list is causing the problem: {{issues}} is a list and the {{sprint}} attribute is a list.
As your trigger uses JQL to find the issues in the openSprints(), let's limit your condition to just check the first one:
{{now.diff(issues.first.sprint.endDate.max).days}}
The other option is to first merge all sprint, endDate values into a text string, remove any brackets, convert back to dates, and then perform the max and diff():
{{now.diff(issues.sprint.endDate.jiraDate.join(",").replace(" ", "").replace("[","").replace("]","").replace(",,",",").split(",").toDate.max).days}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Thanks so much for the reply again. I used both the condition and I was able to run the rule with a status 'Success'. However, email was not sent to my mail id with a list of issues.
Here is the audit log,
Not sure, what the heck is wrong here :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sometimes Data Center works differently than Cloud, and that is where I created those expressions.
Let's try the simpler expression in the condition instead:
{{now.diff(issues.first.sprint.endDate.max).days}}
Also, please write the value of that expression to the audit log before the condition so we can confirm what it contains.
Also please remove all single issue references from your rule, as those appear to be disabling the bulk-handling, which we can see because the condition is listing each issue from the trigger.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bill,
Thank you so much again for all the help so far.
Yes, I made few changes. as per your last suggestions and now I could be able to get email triggered and sent to me.
Email is sent but issues are not attached to this email. I am not sure, what's the issue here is. I think we almost there except this NOT sending issue list in email.
Please see below.
Thanks,
Vijay Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome!
Now, let's add the issue list iteration back into your email, adjusting to the formatting you want:
{{#issues}}
* {{key}} -- {{summary}} -- assigned to {{assignee.displayName}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome! I received the issue list in my email, and it’s perfect. I’m really grateful for your help with this. I truly appreciate it.
I’d love to learn more about JIRA automation. If you could recommend any learning materials (preferably free, but paid is also fine), that would be fantastic.
Additionally, I want to make a few changes to the email format. I’ll give it my best shot, but if I get stuck, I might need to reach out to you in a new thread. For now, I’ll go ahead and ‘Accept Answer’ to close this thread and ensure you get the credit you deserve.
Thank you so much again, SIR!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To learn more about automation rules, I recommend experimentation, perhaps with a test project!
You could create a free Jira Cloud site to experiment with rules, although that will be a bit different than what you see with Server / Data Center version.
There is also free training on automation available from Atlassian: https://university.atlassian.com/student/catalog/list?search=%22Jira+Automation%22&taxonomy_tag_ids%5B%5D=18735&taxonomy_tag_ids%5B%5D=18713
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vijay Kumar - Can you share a screenshot of your final rule for future readers? Thanks and congrats on getting it working!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
My apologies. Couldn't reply to you as I got busy with few other things. Here you go for the final version.
Hope it helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijay - Welcome to the Atlassian Community!
The rule is not executing the way you want because it is not passing on the Advance compare step. In other words, when it ran, it did not find a Sprint with an End Date exactly 6 days from now.
So, you need to make sure that you test with issues that you know are in a Sprint that has that exact end date 6 days from now. Another way to check is to look at a current sprint and calculate the number of days to the end date in your head. Then update the rule to change from 6 to that number and then run it again as a test.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi John, Thanks so much for the reply and I appreciate.
Apologies for my inability to understand the suggestions you made. So let me ask again. When you say, I need to manually check which are all the issues has the end date 6 days from now. Should I check by taking individual issues and see whether that particular issue ends in 6 days? The reason I am asking is, we do have definitive start date and end date for a sprint. My understanding is that a sprint once started with definitive start date and end date, all the issues within that sprint are bound to have definitive start and end date and as we progress, the number of days on the sprint would be reducing. As an example, my current sprint will be ending in 4 days. Please see the screenshot below,
Also you mentioned that, i need to first find current sprint and calculate the number of days to the end date. SO could you tell me what all the smart values i can leverage for this rule? In the meantime, i will also try from my end about these smart values.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why don't you just look for Active Sprint?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes..at any point in time we have only one active sprint. I use following syntax,
{{issues.sprint.endDate.max.diff(now).days}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Vijay Kumar
Welcome to the Atlassian community.
Your post tags indicate you are using Jira Cloud, but the screen images indicate you are using Automation for Jira on Jira Server or Jira Data Center.
When you click on the Help button near your avatar and select About Jira, what information do you get? I'm asking because it will show you a verion number if you are using Jira Server or Jira Data Center, and I want to know what version you are using.
I suspect that the problem is your reference to sprint.endDate . I suggest that you use a Log action to print {{sprint.endDate}} to your rule execution log file to confirm it has the value you expect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much Trudy for the reply & my apologies for the late reply.
Here you go for the JIRA version. See below. I also confirmed with JIRA team that, JIRA instance is hosted on CLOUD.
Secondly, like the way you suggested, i did add 'print {{sprint.endDate}}' to log action. It gave me the same output as it did before. It didn't print the Sprint end date. Please see the screenshot below.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will circle back later with more suggestions for your rule.
I wanted to quick reply that while your Jira instance may be hosted in a Cloud provider, like AWS, that is not the same thing as using the "Jira Cloud" product. Jira Cloud is the Software-as-a-Service version of Jira which is hosted and maintained by Atlassian.
Based on the information in your Help screen you are using Jira Server or Jira Data Center v9.12.12. That is a "self-hosted" product. Your company downloaded the software and installed it themselves on a host that they manage (or that is managed for them by a service provider).
The Automation functionality available in the self-hosted product vs. the Jira Cloud product is a bit different, so it is important to know which product you are using and the version (if self-hosted) to provide relevant guidance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, you need to put the Log action before the Condition. Since the Condition is not passing none of the actions that come after it will be executed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Trudy,
Thanks for the last input. I have put the 'Log Action' before the condition. Now I am able to get the rule executed successfully. But the problem is I didn't get the email with all the issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It appears that you are working through the failing condition, which prevents sending an email, with @Bill Sheboy . I will leave you in his very capable hands on that effort.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No worries! Thank you so much for all the help offered so far. Appreciate it. I could able to learn few things.
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.