Hi,
I am new and not very fluent in smart values, so would appreciate some help:
I have created a confluence template with a page properties macro. In that macro is the project team (i.e. sales, technical lead, project manager, etc). These are often different for each project.
I would now like to use the @username mentions in that page properties macro to send a standard email only to those users.
I have looked on the confluence documentation for smart values, but I cannot find the answer to the problem. I know I am making an error in the syntax, as every time I run the automation rule, i get the following error:
"Unable to send the email as the recipient's email address wasn't provided".
Thanks,
Hi @Ashok Rao ,
On top of what Valerie sad, you can try following the steps described by Manon on this question: Confluence automation - Send email with title based on input of page properties macro
While it's not the prettiest solution, until CONFCLOUD-78944 is released, this could be a way to go.
Cheers,
Tobi
Hi @Tomislav Tobijas _Koios_ ,
Thanks for the response.
That was also my question, from a few weeks ago. :)
It's what made me think that a solution was possible, But even with that, I cannot find the exact syntax to make it work. Every try I've done results in the same error message in the log: "Unable to send the email as the recipient's email address wasn't provided"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My apologies m8! Didn't even consider checking who's the author of the question 🤦♂️
I think I'll have some extra time in the next couple of days so I might test it out and try to find the 'workaround'. If I manage to get it to work, I'll share it here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ashok Rao I've managed to get it to work. Although, a slight notice is that this solution is based when only one user is mentioned in Page Properties table row. In order to get it to work for any number of mentioned users, you would need to adjust parsing content from the page (in this example variable part) and then probably use branch based on string of account IDs which would be stored inside mentioned variable.
Anyway, all of this is based on answer Manon provided with additional part of getting account email from account ID which is visible in the page body part.
Here's a page example:
Firstly you can create variable and use the following:
{{page.body.storage.substringBetween("Client names</strong></p></th><td><p><ac:link><ri:user ri:account-id=\"","\"")}}
This would get you ID of the account that was mentioned.
*👆 change string Client names if necessary; this is just a name I've used in my page properties table (see first screenshot)
Next, you would need to send a web request to the Atlassian site to get user details. For this, use account ID which is stored in previously created variable. Web request URL would look something like:
https://sitename.atlassian.net/rest/api/3/user?accountId={{accountId}}
For authorization part, take a look at the following article: Automation for Jira - Send web request using Jira REST API
And lastly, you can then use
{{webResponse.body.emailAddress}}
smart value and add it to "To" part of the Send email action in automation.
Hope this helps.
Cheers,
Tobi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the delay in responding, was on holiday :).
But thanks a lot! It's working perfectly.
Regards,
Ashok
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 @Tomislav Tobijas _Koios_
I can’t express how grateful I am for your detailed instructions! I managed to make it work as well, so thank you so much!
I also want to say a big thanks to @Ashok Rao for starting this topic—it’s really exactly what I needed.
I was wondering if you could show me the principle for this part:
"you would need to adjust parsing content from the page (in this example variable part) and then probably use branch based on string of account IDs which would be stored inside mentioned variable."
I’m new to Confluence automation and all my attempts to make the flow match my use case - failed. Here’s my use case:
It works perfectly when there’s only one reviewer, but there can be more. I tried using branches but couldn't make it work, could only get 400 :) I’d really appreciate a step-by-step explanation or guidance on how to adjust this for multiple reviewers.
Thanks again for all your help!
Best regards,
Tania
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have found a solution that works for us. It might not be the best but it works :)
We set a limit for reviewers and added a variable for each reviewer.
{{page.body.storage.substringBetween("Reviewer 1</strong></p></th><td><p><ac:link><ri:user ri:account-id=\"","\"")}}
The same for Reviewer 2 and Reviewer 3.
All mentioned reviewers are notified via email when the page status changes.
Key points to note:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tetiana T_ ,
I'm pleased to hear this topic helped you, but of course credit goes to @Tomislav Tobijas _Koios_ for the detailed instructions. :)
I also have not managed to send a mail to multiple people, so if someone could add instructions for that, that would be great. I would be curious how exactly you do that.
But, just like you, I have also solved it by sending multiple different mails inside the same automation rule. This was actually very suitable for my use case, because I could then customize the mail that I would send to each team member, specific for their role in the project.
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 your response @Ashok Rao! That’s a great workaround, especially since it allows tailoring communication for each recipient.
However, after testing the setup with my team today, I noticed an issue I haven’t been able to resolve yet. The system successfully extracts and sends emails to my address but fails with others. After the successful web request, at the Send email step, it returns: Unable to send the email as the recipient's email address wasn’t provided.
I’ll keep working on figuring out the cause and hopefully resolve it soon.
Best regards,
Tetiana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ashok Rao , thanks for your question
Please can you share some screens of the automation rule so we can see how far you have got and how you want the rule to work? For example, what is the trigger? Are there any conditions? I appreciate you're asking for help with the actions but for us it's helpful to see the whole picture.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, sure:
So, in the template, I have the page properties macro below:
I want to send a mail to the users that are filled in.
Not sure where I'm going wrong here. As I said, I'm not really very experienced in the syntax of smart values.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ashok Rao , sorry, after checking the smart values documentation for Confluence, it seems you can't access the Page Properties Macro values yet.
There is a suggestion for this open with Atlassian, which you can vote on https://jira.atlassian.com/browse/CONFCLOUD-78944
For now, these are the smart values that are supported https://support.atlassian.com/cloud-automation/docs/smart-values-in-confluence-automation/
Sorry to disappoint.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Valerie Knapp ,
Thanks for confirming this. At least I know now to stop trying and wondering why it won't work...
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.