I am trying to create a weekly Slack Report using Jira automation for issues that are near due or overdue and have the Slack alert formatted to show the count of issues in each category and the list of issues with some of their details.
I can trigger the automation successfully when I manually trigger it, but when I try to run the scheduled one, it is sending the message 3 times. I turned off the checkbox for running the rule for all issues triggered as I thought that may be why but I'm now getting new error messages.
I have been branching for Overdue and then a new branch for near due but I don't seem to have a good option for branching. I currently have for Current Work Item, but I can see why that is triggering a message. I have been circling on this for hours over the past 2 days and it's driving me bonkers at this point.
Here are some screenshots of what I'm doing, what I'm seeing and a Slack message that worked when run manually.
When you want a scheduled rule to run and to send a single message, do not include the JQL in the Scheduled trigger. Instead, use the Lookup Work Items action with the JQL to gather the work items and then iterate over them in the message.
And...rather than use conditions, add all the criteria to the JQL.
For example:
I added a smart values condition so the message is not sent when there are no results found. You could instead remove that and tailor the message send a "nothing found" type of message.
Kind regards,
Bill
I will try that out now and I can send you the whole automation shortly too. The missing part is almost identical to the overdue items, but it's looking up overdue items instead. I'll get back to you shortly!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the full automation. I'm doing my best but I'm still a bit of a beginner with the smart values. I did move up the Lookup issues before the branching and changed the action to branch by JQL but seeing the whole automation will likely more make sense b/c one Slack message is being sent for the overdue and near due for the weekly report. Once I changed to the following - I now get one message but no values.
The first branch:
This is the details for the second Set Entity Property:
The second branch details:
Details of the second Set Identity Property in the 2nd branch:
Details for the Send Slack Message after the 2 branches:
Slack message that came this time w/o the values:
And the Audit Log Details:
Thank you so much for offering advice and looking at the details. It's greatly appreciated!
Jennie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let's back up a bit: what problem are you trying to solve? That is, "why do this?" and "what does success look like?" That context may help clarify the scenario.
For the rule information you show...
What is the purpose of setting the entity properties?
And if they are necessary, where should the values be stored as the values appear to span multiple work items?
What is the purpose of branching? I was suggesting the use of Lookup Work Items so the branching is not necessary to send a single message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I love that question - always such a great one. The request that I got was to create a very specific templated report in Slack every Monday am for awareness of any overdue or near due vulnerabilities as shown:
I had started out with a completely different approach. I was going to have a branch for Overdue and send the Slack for overdue count and the list of issues. Then the second branch would do the same for the near due and a final step would be to add the Slack message for the Action Items.
I think that I was probably a little over my head, so I went to ChatGPT which helped in some ways but went in circles for awhile. I really wanted to try on "my own" first though. But, I should have come to the Atlassian Community first as you all have helped me every time!
Jennie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First thing...in general, I recommend against using bots (including the Atlassian one) to answer automation questions: your Jira site configuration information is not visible to such tools and thus their "guesses" are based on generic information.
Back to your question...
Thanks for the additional details, and I believe my earlier suggestion will help with a slight modification to allow getting both the overdue and due-soon items. This aspect would use smart value, list filtering to help.
project != SECOPS
AND category = "EPDD Project"
AND issuetype = Vulnerability
AND status != Done
AND (
due <= startOfDay()
OR ( due > endOfDay()
AND due <= 30d)
)
Weekly vulnerability info
*** Overdue ***
count: {{#=}}0{{#lookupIssues}}{{#if(duedate.isBefore(now))}} + 1{{/}}{{/}}{{/}}
List:
{{#lookupIssues}}
{{#if(duedate.isBefore(now))}}
* <{{url}}|{{key}}> -- {{summary}} -- days overdue: {{duedate.diff(now).days}} day(s)
{{/}}
{{/}}
*** Due in next 30 days ***
count: {{#=}}0{{#lookupIssues}}{{#if(and(duedate.isAfter(now), duedate.isBefore(now.plusDays(30))))}} + 1{{/}}{{/}}{{/}}
List:
{{#lookupIssues}}
{{#if(and(duedate.isAfter(now), duedate.isBefore(now.plusDays(30))))}}
* <{{url}}|{{key}}> -- {{summary}} -- due in: {{now.diff(duedate).days}} day(s)
{{/}}
{{/}}
The way the counts / filters work is:
And thus, it does not appear there is a need for the entity properties. Would you agree?
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! I will adjust tonight.
I fully agree that I shouldn't have gone to ChatGPT. I was hoping it would help lead me closer to the right direction but I literally spent hours going in circles. Lesson learned! Especially when the Atlassian Community not only exists but is always so responsive.
And I would agree that there doesn't appear to be a need for the entity properties. I was just so turned around that I was grasping at anything at that point.
I'll follow up with you later and let you know how I'm making out.
Jennie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sounds good, and as a tip:
You do not need to wait for the schedule to run for a test. After updating the rule, from the editor's ... menu at the top-right, select "Run rule" so it runs immediately.
If the extra testing messages in Slack would be too noisy for the team, perhaps just write to the audit log first and then switch to Slack when everything is working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jennifer,
For these types of triggers, you need to apply a filter in the automation. When you check the box, the automation runs based on the JQL query. If you leave it unchecked, you’ll need to perform a search before the branching step.
Have you tried moving the Lookup Issues action before the branch and then branching on the {{lookupIssues}} smart value?
Also, could you share the full automation so I can take a closer look?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deivid,
Here are the full details of the automation. And thank you for trying to help me out!
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.