Hi,
I have created a page template for my team, and part of that template is a page properties macro with some basic project information (such as name of client, internal project ID number, etc)
Now I would like to create an automation rule to send an email to my team, whereby the title of that email contains some of the information filled into that page properties macro.
Obviously the trigger is 'page published', with a condition added that it can only trigger when using a specific template. However, I am stuck on how to use the information from a page properties macro in the title of an email.
Hi @Ashok Rao and welcome to Community!
As mentioned, you can use Confluence smart values to extract content from your new page. Here's a page example:
And the automation rule that extracts the client name, in this case "ACME":
Details below:
{{page.body.storage}}
{{page.body.storage.substringAfter("Client name</strong></p></th><td><p>")}}
{{page.body.storage.substringAfter("Client name</strong></p></th><td><p>")}}
{{varClientName.substringBefore("</p>")}}
This will give you the name of the client, which you can then reuse in emails.
Hope this helps!
- Manon
I actually just remembered an even easier text function, you can just use this one to get the client name:
{{page.body.storage.substringBetween("Client name</strong></p></th><td><p>","</p>")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One small thing remains though: I guess I will have to trigger that email manually also? I can only trigger your rule after publishing the page, so automatically triggering sending the email as the page is published is not possible?
If that's the case, I will have to pay attention to always first trigger the rule to create the variables, and only after that trigger the rule to create the email.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can change the trigger to the "Page published" one, I just used the manual trigger for debug purposes :)
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 ,
You might try using {{page.body}} smart value to get all content from the Confluence page. With that, you probably could parse that data and extract what is needed.
Additionally, you could use automation web requests and Confluence REST API, again to get the page content and potentially parse it within automation.
You could then use this parsed data to send the email notification with the desired content.
Here are some additional references to docs that might help:
Maybe, as a workaround, you would leverage labels and consider adding those to these specific pages as well, and then use smart values for labels to get that additional info you wish to send in the email notification.
Cheers,
Tom
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.