Hello,
I created an automation that send a notification to slack when the issue passed the Due date or is near the Due date.
Now, I want to add a weekly report that calculates the number of issues that: passed the due date, near the due date, opened or closed in the previous week.
I want to send the Email/slack message like this:
Number of issues that Opened this week: X (number)
Number of issues that Done/Closed this week: X (number)
Number of issues near the due date: X (number)
Number of issues that passed the due date for now: X (number)
I would like to get any help if somebody know how to create automation for that
Thanks
Hi @Hadar Dinte
What have you tried thus far to solve this? Using automation rules often requires learning and experimentation, so the documentation and examples in the template library can help.
If you have not started yet, I suggest using the Lookup Issues action with JQL to capture the issues for each of your measures. Then save the count results using Create Variable actions, where each count would be {{lookupIssues.size|0}}
Then you could report all of the measures in your message by referencing the created variables.
Kind regards,
Bill
Hi Bill, Thank you very much! it's work.
The only problem I have is that I get a number of messages to Slack according to the first action that I did in the rule.
For example, if the rule found 3 issues that created last week, so I will get 3 messages.
I would be happy to know if do you have any idea why it's happening, and how to solve it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I suspect the cause is you are using a Scheduled Trigger with JQL, which then runs for each issue found. The fix is to remove the JQL from the trigger.
For example:
If that does not help, please post images of your complete rule and the audit log details showing the execution. Those will provide context to help explain the symptoms.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please post an image of your entire rule, as I believe that will show you are referencing issue fields and not just the created variables or the lookup issues results.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I dont know if it's elegant work, but I wrote a Query in the JQL tab that the result of this query is 1 issue - so in the end I got only 1 message of the summary.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another question I have is,
If there is a way to make the smart value in the slack message hyperlink? Because I need that the hyperlink will lead to a list of the issues, and not only for one ticket
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Until you post the image of your entire rule, I don't know how to answer the questions you are asking about the errors.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
When posting an image of long rules, I recommend using a browser extension (or app) which can capture a complete, scrolling browser tab view.
Back to the error you observed, the cause is because the rule is referencing an issue's fields in the condition test on Issue Type. That condition is not needed for the scenario you described.
Instead you can do this, as I suggested earlier:
Please note there is no JQL for the trigger. All of the issue information comes from the Lookup Issues actions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, it works.
Now, I would like that the numbers that I get in the Slack message will be hyperlink, and will lead to the list of the issues.
I tried to add the world URL to the new smart value in the slack message, for example: <{{issuecreated.url}}> but it is not work
Can you help me with that, please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Created variables are text, and so there are no other attributes, such as url.
I can think of two ways to do what you ask with a link to the issues...
a) Add links for each issue in the lookup after the number, with
{{#lookupIssues}}{{url}}{{^last}} ; {{/}}{{/}}
b) Use HTML formatting and encoding in your Slack message, and make a link for the number as a reference to a JQL search of the issues. For example,
<a href="https://yourJiraURL/issues/?jql=JQL from the lookup">{{varIssuesCreated}</a>
This can also be made dynamic if the JQL and URL values are stored in variables and combined later.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Bill Sheboy
I didn't succeed with the first option.
For now, I passed the Query's URL to the slack message. Unfurtantelly it's not elegant work, but its work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Bill Sheboy ,
According to this automation, Could it be that the {{lookup issues.size}} don't know how to count more than 100 issues?
Thanks,
Hadar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is correct: the lookup issues action has a limit of 100 issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Hadar Dinte
I stumbled upon one thing that might help with the weekly report. I had a similar setup with Slack notifications for due dates, and I found this for JIRA and Slack integration. It works as a pre-made solution that you just use in your environment: https://www.getlazy.ai/templates/jira-weekly-done-issues-to-slack-fc1657c7-1588-47ef-a48e-249d846db7a8 (sorry for the link, hope it's allowed here)
They have a guide there, it walks you through setting up the JIRA and Slack connection, and it automatically fetches closed tickets and posts them to Slack every week. For me it was super handy for generating those weekly reports without much hassle.
Hope that works for you too
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Hadar Dinte
To create an automation that sends a weekly report
1. Create a new Jira automation rule and select the trigger "Scheduled", and set the trigger to run once a week on a day you prefer.
2. Add the action "Jira: JQL Search" to the rule. In the search query, you can use JQL to search for issues
Below I am sharing some of the alternative JQLs that you can use to filter issues and get the count:
created >= startOfWeek() - 7d AND created < startOfWeek()
status changed to Closed during (startOfWeek() - 7d, startOfWeek())
duedate >= startOfDay() AND duedate <= startOfDay() + 2d
Number of issues that passed the due date for now: X (number)
duedate <= startOfDay() AND status not in (closed, resolved)
3. Add the action "Send a Slack message" to the rule, and format the message using the results of the JQL search.
Here is the sample yaml code
Number of issues that Opened this week: {{#=}}{{searchResults.created}}{{/}}
Number of issues that Done/Closed this week: {{#=}}{{searchResults.status changed}}{{/}}
Number of issues near the due date: {{#=}}{{searchResults.duedate <= startOfDay() + 2d}}{{/}}
Number of issues that passed the due date for now: {{#=}}{{searchResults.duedate <= startOfDay()}}{{/}}
I hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tuncay, Thank you very much.
Do I need to enter the yaml code in the message of the "Send a Slack message" action?
And I didn't understand how the yaml code know which data he need to take?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
About the JQL's, I already have some of them, but I get the list of the issues and I need the sum (number) of them
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.