Hello,
I am creating a rule to send watchers of issues an email when the due date is approaching. I have used the template that available for use but altering it so that the watchers on issues get the email instead of the assignees.
I got the rule to run successfully yesterday and today I am have an issue when I run the rule that an error occurs in on of my lookup components.
Below I will attach images of the flow and where the error is.
I don't understand how I am still getting the email but also an error.... Any help apricated.
Thanks
The "watcher" field is the list of watcher users, and the plural "watchers" field is a count of the number of watchers. Please update your JQL accordingly.
Unfortunately, this is different than the rule's smart values, where {{issue.watchers}} is the list of users.
Next, when trying to branch over a list of users watching issues...within a list of issues from Lookup Issues, that is a list-of-lists, and so the distinct function will not work directly.
Instead all of the values must be joined to eliminate the nested lists, and then finally the list may be split and distinct used. For example:
Kind regards,
Bill
Hello @Bill Sheboy
Thank you for your help here. I was unaware of the difference between the 'watcher' and 'watchers' fields.
My issue now is the email will not send. The error is ''Unable to send the email as the recipient's email address wasn't provided''
I have gone through an array of different values to try send the watcher email... not one has worked.
e.g. {{varWatcher.emailAddress}} ; {{varAllWatchers.emailaAddress}} ; {{lookupIssues.varWatchrer.emailAddress}} ' {{issue.varWatchrer.emailAddress}} and many more combinations and I am not sure where I am going wrong......
Any suggestions?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I forgot you also needed the email address!
There are several ways to get that, but as we already had it with the watcher list, let's capture it for use later, building on what we started above. As a slight change, we will store the watcher fields for accountId and emailAddress as JSON, allowing use of the jsonStringToObject() function later...and making testing easier.
{{#lookupIssues}}{{#watchers}}{ "accountId": "{{accountId}}", "emailAddress": "{{emailAddress}}" }~~{{/}}{{/}}
The update to the varAllWatchers variable uses "~~" as a delimiter now because we are using JSON with commas between the fields. The final result would look like this when it has data:
{ "accountId": "12345", "emailAddress": "email for user 12345" }~~{ "accountId": "45678", "emailAddress": "email for user 45678" }~~
This makes parsing it easier as we can access each field with dot-notation in the same way as issue field, smart values.
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 for your help. I have got it to run successfully!
The JQL I used in the last 'Lookup Issue' was the following:
duedate = endOfDay({{dayOfIssue}}) AND statusCategory != done AND watcher = "{{jsonStringToObject(varWatcher).emailAddress}}"
And then in the email field I used {{jsonStringToObject(varWatcher).emailAddress}}
I was actually still getting my original issue where I was getting the email but the flow was erroring. I managed to fix it by adding " " around the {{jsonStringToObject(varWatcher).emailAddress}} withing the last look up component.
Anyways, it is working now with no issues! Thank you so much for your help :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn that helped.
For the JQL in the lookup checking the watcher, the account ID value would have worked with (or without) quotation marks rather than using the email address.
I didn't even know JQL could check watchers using the email address, so I learned something new. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bill,
Sorry to follow up on this, but I have tried everything with no avail. now that the flow runs with no issues when there is a day that an issue is due i.e. a issue is due in 3 days time, but now i run into another error that the flow 'breaks' when there is no issue due, causing the flow owner to get an email about it...
This is not a major issue as the flow will run the next day with no issue (if there is a ticket due) but the constant email that it failed is quite annoying.
Do you have any suggestions?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You want the rule to not send the email when there are no issues, and that may be done adding a condition after the first Lookup Issues action, checking the count (i.e., size of the list of issues):
Although from the audit log you show, it seems there were issues to process...or the an empty entry was processed by the advanced branch!
Would you please show an image of your current rule? I am specifically interested in what is getting written to the log as that show nothing for the run on 18 February.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Bill,
Yes, when there are no issues due, no email is to send. I tried this flow by using a 'branch rule' which gave me no error when there was no email due, but if there was multiple tickets a user is watching, they would get multiple induvial emails...
It is a scheduled rule and it runs every morning.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try adding that Smart Values Condition I described immediately after the first Lookup Issues action. That will prevent the rule from proceeding when there are no issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
I am only coming back to this issue we were having now
That worked.
Thank a mill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please disregard my previous response. i was able to replicate your issue.
Below rule 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,
Unfortunately that didn't work for me.... I am still getting the same error as I was before hand....
The issue seems to be that the watcher field not accepting the value, please see the image below
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's because as @Bill Sheboy mentioned watchers is a count of number of watchers.
You need to use watcher without s.
of course, the automation needs to be enhanced incorporating Bill's suggestion
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.