We are working to set up automations to notify specific parties of tickets that have been open and stagnant for 90 and 180 days. I created the automations to the best of my knowledge but we have found the following two results.
We are hoping to have it generate a single email with a list of all tickets found in the trigger. I am not sure where to go from here. I am pasting the code I used below in the JQL script. The screenshots attached show the rule I have set.
---------
status = "In Progress" OR status = "Waiting for Support" OR status = "Waiting for Customer" OR status = "Support Review" OR status = "Waiting for Vendor" OR status = "Waiting for Approval" OR status = "Development Review" AND updated <= -90d
---------
Thank you!
Hello @Jeren Wunder
What are the details of your Send Email action? The email generated will include only the content you specify in that action. It does not automatically include issue information unless you add to that content the smart values to obtain that issue information.
If you want a single email generated that includes a list of the issues, then rather than put a JQL into the trigger I would recommend instead having a Lookup Work Items action after the trigger and put the JQL into that action. That gets you a list of all the issues contained in the smart value {{lookupIssues}}. To then print out information about each issue in the list in a single email you would use syntax such as
{{#lookupIssues}}
* {{key}}
{{/}}
This syntax instructs the system to list the value from the key field for each issue in the lookupIssues list. The asterisk and the space after it are literal, so the output would look like:
* ABC-111
* ABC-222
* ABC-333
I probably am missing some coding but I am new to these scripts. Here is my Send Email action. I am just sending it to my own email for now due to the spam issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that screen image @Jeren Wunder
As I suspected you don't have any syntax in the Send Email content to include any information about the issues. You have to proactively include that in the content - it won't be added automatically.
You have to add Smart Values to the content of the email to include details from the issue. The specific smart values to include depend on the structure of your rule and which fields from the issue you want to include.
Because you mentioned that you want only one email sent, and for that one email to include a list of the issues, I reiterate my recommendation that you remove the JQL from the Scheduled trigger and instead use a Lookup Issues action that includes that JQL.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, I believe this is what I need to do and was missing. I will attempt to set that up this morning and let you know how things go. I am only needing the ticket number and title for each ticket selected by the lookup. I am very unfamiliar with coding. Is that easy to set up with those Smart Values? Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Jeren Wunder
key is the ticket number; i.e. ABC-123
I believe what you are referring to as "title" is the summary of the ticket which shows here:
If you set up the email content as I have shown the each ticket's number and title will be listed in the email.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is what I have entered and I am not seeing anything sent to my email when I run the rule. Not sure what I am missing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jeren,
Have you reviewed the Audit Log for the rule execution to see what information that has?
Notice the Audit Log link on the right above the Send Email configuration panel. If you click on that it takes you to a log for that rule with an entry for every time you saved an update to the rule and every time the rule ran. Find the entry that corresponds to when the rule ran.
Click the ">" character on the right to expand the details.
Within the details click all the ">" characters to the right of message to expand to show more details. Then share a screen image of that with us.
You can also double check that your Lookup Issue action has a valid query that returns results. In that action you should see a Validate Query button.
Can you confirm also that you removed the JQL query from the Scheduled trigger?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am not seeing any running in the Audit Log from today's changes. The query does find items when validating. I did remove it from the trigger. I will attach a few screenshots.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could there be an issue in the spacing, character, or spelling with the smart commands below my content in the email section? I pasted it below.
{{#lookupIssues}}
* {{key}}: {{summary}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looking at the trigger you have it set up to run once per week (1) and the next run will occur on Dec. 22 (2)
The rule will not run immediately when you save a change. It still runs on the schedule you set.
If you want to manually trigger it to run immediately you can select the "Run rule" option from the actions menu. This applies only to rules that use the Scheduled trigger.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I am clicking Run Rule and then checking. There does not seem to be anything happening.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hold up. I had it disabled. Once I tried while it was Enabled I think we have success! So is there an easy way to learn the coding you gave me for the Content in the email that actually grabs certain info from the ticket I want?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
TL;DR
Look for courses in the Learning link at the top of the page, review documentation from Atlassian, experiment with the rule templates, and review Questions in the forums that concern Automation.
----
What we did was get "smart values". Different smart values are needed depending on the circumstances.
There are multiple pages of documentation on smart values starting here:
https://support.atlassian.com/cloud-automation/docs/smart-values-in-jira-automation/
There is a page in there specifically about accessing built-in fields in an issue/work item:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/
For custom fields you have created they can generally be accessed by using the field name (case and space sensitive) but if you have to find the ID to get the right field this document provides guidance:
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
In the larger Automation Smart Values documentation area you will also find pages about other types of smart values, like how to do calculations, and access information in a smart value that represents a list of data, and how to manipulate date/time fields.
Some Triggers and Actions also provide unique smart values, like the Lookup Work Items action making the {{lookupIssues}} smart value available. Those are usually mentioned in the Trigger or Action documentation.
There are a variety of ways to get more familiar with Automation.
There are free, on-demand classes available from the Community Learning link at the top of the Community pages. Here is a general search for Automation topics related to Jira. You can further filter by experience level.
https://community.atlassian.com/learning/catalog?product=Jira&search=automation
There are also template rules available within the Automation tool itself. You can look at those to see how they solve different needs. You can filter for rule templates by category also.
I learn a lot by reviewing the questions that come up in the community forums related to automation. I do a lot of experimenting in a personal free Jira subscription (so that I don't affect production data) to learn more.
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.
@Trudy Claspill I did get it generating info but now it seems I may have a new issue. It is not doing the 90 days or 180 day thresholds properly. For example, the first ticket listed was created two days ago. Is something wrong in the JQL script coding?
(Let me know if this should be a separate post.)
status = "In Progress" OR status = "Waiting for Support" OR status = "Waiting for Customer" OR status = "Support Review" OR status = "Waiting for Vendor" OR status = "Waiting for Approval" OR status = "Development Review" AND updated <= -90d
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do I understand correctly that you want only issues that are set to one of the specified statuses and that are also last updated 90 or more days ago?
If so, I suspect that it is your use of OR without parentheses that is resulting in getting you issues in any of the first 6 statuses without applying the date criteria, and the date criteria being applied only to the issues in the 7th status.
I recommend this JQL instead:
status in ("In Progress", "Waiting for Support", "Waiting for Customer", "Support Review", "Waiting for Vendor", "Waiting for Approval", "Development Review") AND updated <= -90d
If those statuses represent all the statuses in your project that show as Blue (vs. Green or Gray) then you could further simplify your query as this:
statusCategory = "In Progress" and updated <= -90d
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe that did the trick. Thank you for your help. You have been VERY helpful!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jeren Wunder ,
In addition to the great answers provided by Andy and Trudy, you can also make use of Jira Filter Subscriptions. This feature lets you create JQL filters, and then subscribe to the results of those filters.
https://support.atlassian.com/jira-software-cloud/docs/manage-filters/#Subscribe-to-a-filter
It seems you already have the JQL for the two time periods you are interested in, so all you'll need to do is set up those filter subscription, and you're done!
Hope this helps,
Robert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adding to this...
If the email needs to go to individual users, those individual users must be licensed users of Jira, have access to the issues through Jira, and setup uf the subscriptions to the filters themselves.
A person cannot set up a filter subscription so that the output goes to another user. They can set up a subscription to be delivers to a User Group, which helps if the intended recipients have been defined in a User Group.
And if the recipient doesn't have access to view the issues in Jira already, then the output they receive will be empty.
But using a filter subscription otherwise is a great solution that does not count against your Automation usage.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jeren Wunder ,
Thanks for using the Community! I believe the reason that it is sending an email for every issue returned in your JQL is that you have the 'Run a JQL search and execution actions for each work item in the query' option checked. This will perform the subsequent actions in the Rule for every Work Item returned.
If you want it to just sent a single email with the list of issues you will want to uncheck that option.
In terms of the iterating over the list of returned issues, you would likely want to implement something like what is described within Lookup Work Items using the {{#}} and {{/}} operators to set up a loop. Without seeing the syntax of the notification it is difficult to weigh in on specifics, but something like that would need to be set up to iterate over the issues returned.
If you want to post a screenshot of your notification action I might be able to weigh in further.
Best,
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Andy Rusnak
The option to bulk-process work items for the Scheduled trigger and JQL branches only applies for Jira Server and Data Center automation, yet this question appears to be for Jira Cloud.
Instead, a Lookup Work Items action may be used, such as described in this KB article for gathering and sending the items by assignee:
Kind regards,
Bill
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.