Hello,
we would like to create an automation to send every day an email with the resueme status:
For the first point we could use the automation in the library named When a task is near due → send email reminder.
So, for the second point we have tried to modify the automation to get the dinstinct watchers in the For each: smart value step
{{lookupIssues.watchers.distinct}}
{{lookupIssues.watchers.split(",")}}
We did several attempt trying to look at the documentation and at other post, but there seems to be no way to get dinsinct watchers and then send a single mail to all the user with the list of Jiras.
Probably we need to completely change the automation principle, do anyone have an idea on how we could do it?
For a question like this, please post images of your complete rule and the audit log details showing the rule execution. Those will provide context for the community to offer suggestions. Thanks!
Until we see those...
I am guessing you are using an advanced branch to iterate over the watchers:
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 can do this in two steps, as I do not believe this is possible in one step...
That last line removes the square brackets from the arrays, and then splits the text field on commas...which converts it to a list. Now the distinct function can be used.
Once you have tested to confirm this works as you expect, you can use the smart value expression (or the varMergedWatcherList variable split again on commas) as the source for your Watcher, advanced branch.
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 think that now I'm very near, I just need last thing that I don't understand.
Going step by step, in the first phase I'm creating the variables as you suggested.
After each step I'm sending an email to me to verify that the variables are ok.
Since there are 3 jiras with 2 different watcher only, the variable varWatcherList is an array with 3 elements.
After the second step the 2 watcher are correctly extracted.
In the second part of the jira I want to dinstict the watcher.
For every watcher I send to me this email, but the emailAddress and displayName is empty
Here the result for the 2 watchers.
So, what I miss is to extract the email address because the last step is this:
And emailAddress is always empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that is correct, as you only have the account id and not the other fields. (The default field for a Watcher is apparently accountId, and not the entire user object).
When I pause and re-read your original question about Watchers, I do not think this is possible in the way you asked with a rule. I wonder: what problem are you trying to solve by pushing information to the watchers...when watchers are just observing for changes?
Next, a few work-arounds:
watcher = currentUser()
AND statusCategory != Done
AND duedate <= endOfDay(2d)
Finally, an explanation of why this probably cannot work in a rule:
The reason is that inside the scope of rules, my experimentation shows Watchers behaves both like a list and an array. And Watchers cannot be used directly as a source to an advanced branch. To get at the other fields you would need to parse out all of the data for use later, like this:
{{#lookupIssues.watchers}}{{accountId}}|{{emailAddress}}|{{displayName}},{{/}}
But...if you try that, you will find Watchers does not work as expected (like a list); instead it puts all of the accountId values together, and then the email addresses, and so forth.
myAcountId,yourAccountId|myEmail,yourEmail|myName,yourName
That will not help when you need to use distinct later, and to access the individual pieces.
Sorry I could not be of more help on this one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
thank you again for your time.
The purpose of this rule are multiple:
Anyway, thanks again for the deep explanation, we will think about a possibile alternate solution or just give up if no one else can provide a different proposal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How about using that filter (or others) with a shared Jira dashboard? People could pull (rather than a pushed email) when they want information about their assigned items, or watched, or etc.
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.
Hi @Bill Sheboy
so here some more details.
This is the starting rule:
Where For each: Smart Value is
And I'me trying to substitute it with something like
And then
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In particular the result of this rule is that I get several email for every different group of watchers:
if there is at least a Jira with only me as watchers in the related email I get the right list of Jira near to due date.
Here what I get when there is 1 jira with just me watching and another with another watcher:
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.