I have a custom field named "Stakeholders" - {{customfield_10114}} which may contain multiple users. I would like users in this custom field to receive an email notification when the issue transitions.
I've set a fairly simple automation for this, but it's not picking up on the smart value for my custom field. (See screenshots attached)
Any ideas? I suspect the issue is the next gen project type, since custom fields are handled differently, but I'm not sure.
Hello @Jessica Kizmann
You have to tell the automation from which issue has the data in that field that you want to use. When referencing an issue field in Automation you need to prefix it with "issue." like this:
{{issue.<field>}}
{{issue.Stakeholders}}
{{issue.customfield_10114}}
"issue" is the issue currently in context. In your Automation there is no change of context (i.e. branching) so "issue" will work. If there was a change of context (i.e. the action was within a branch) and you wanted to reference data from the issue that triggered the rule, then you would use "triggerIssue".
I tried it with both {{issue.Stakeholders}} and with {{issue.customfield_10114}} but I'm still getting, "Could not send email, the 'To' address field is empty. If you have referenced a field it may be empty."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see the same thing when I reference the field with a smart value.
You should not need to use a smart value here.
When you are in the Send Email action and you click in the To field you should see a list of fields to select. Do you see the Stakeholders field in that list? If you don't see it in the list, does it appear if you start typing it in?
If you can find the field in the list or by typing it in, select it and see if that then sends the email (assuming the field is not actually empty for the triggering issue). When I pick the field itself, then the rule is able to run successfully and does send the email.
I suspect that using the smart value the system may expect that to be explicitly the text of a valid email address, which it is not in this case. When you specify a User Picker field, the Automation knows how to interpret that to get the emails for the specified users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, no, it's not showing there even when typed manually. I assume because it's a field I created and not a default.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, I missed an important detail. You're working with a Team Managed project.
Automation for Jira does not yet support the People field used in Team Managed projects, unfortunately. I have found that listed in multiple change requests in the backlog:
https://jira.atlassian.com/browse/JSWCLOUD-22200
https://codebarrel.atlassian.net/browse/AUT-1651
https://codebarrel.atlassian.net/browse/AUT-2248
The problem is also mentioned in several community posts. Here is one that mentions a workaround using the Send Web Request action to get the email addresses (thanks @Bill Sheboy ):
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for following up, that's what I suspected. I tried Bill's method but that doesn't appear to work either. I'll keep seeing if there's any other methods to notify folks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all
I was struggling today with the same issue, and found a workaround that worked for us fine, so I wanted to share, maybe it helps others in the future:
Add a step in the automation before sending the email, to add the people from the custom field ("Travelling" in our case) to the issue watchers.
Then the email can fetch the To field from the Watchers email attribute.
I guess if people don't want to remain watchers, you can add one more step to remove Watchers afterwards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Works great for me Thanks :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
Thank you for this thread. It's been helpful as I try to also send an email to the users added to a custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Emma Sunderland
I need the same automation as the one you mentioned above (send an email to the users added to a custom field). Could you help me with it?
How should I set this one?
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think I could get it to work in this way. I had to make use of the Watchlist instead.
I created a custom field with a drop down menu, which when Yes was selected, this fired an email to the Watchlist.
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.