My team meets once a week to share what we’re working on, important news or updates, and discuss projects that need input from other team members. To encourage active participation in the meeting, the moderator is set on a round robin basis. For several months, either that week’s moderator or myself would generate the notes page a day or two in advance of the meeting, and then post a message in our Google chat to share the link.
But then I started exploring Confluence Automation, and realized I could set up a rule to do all this for us. So here’s the story of what I created and some of the difficulties I ran into along the way.
Our weekly team sync uses a template. One of the recent modifications I made to the template was to embed a Confluence Calendar that displays the dates for upcoming emails, events, and content publication. Here’s what it looks like when the template is used to generate a page (the Calendar isn’t visible in the template and only populates when you create a page)
I do have to manually update the template every 6-8 weeks to adjust the dates and the person listed as the moderator, but maybe in the future I can figure out how to use a Rovo agent to do that.
My rule just has 3 parts:
Trigger: Scheduled for every Tuesday at 9 am
Action: create page
2nd action: send web request
There are native Automation actions to send an email, send a notification to Slack or Microsoft Teams, but for Google Chat, you have to make it yourself with a web request.
So first action in my Automation was creating a page: easy. I used the drop down options to select the space and parent page (actually a folder), and the template I wanted used.
BUT, I wanted the page title to include the date, and I wanted the date in a specific format and I struggled a bit to figure out how to get it to work.
I started with using {{now.shortDate}}
Since my goal is to create a meeting notes page 2 days before the weekly meeting takes place, I needed to add 2 days.
So I wrote
{{now.shortDate.plusDays(2)}}
following the pattern given here
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
But it got ignored when I trigger the rule, and no date was included in the page title.
After some experimenting, I realized shortDate needs to go after the plusDays. And in the end I didn’t use shortDate because I wanted a slightly different date format.
Here is the final smart value set up: {{now.plusDays(2).format("dd-MM-yyyy")}}
If you’re looking for more details on date time formatting, here’s the Java documentation https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
Next step, I wanted a notification to be sent to a specific Google Chat space.
This required configuring a web request.
Step 1: Go to the Google Chat space settings, under Apps and integrations. Add a new webhook and copy the URL
Step 2: Configure the web request
Paste that URL in the Web request URL
Select Post for the HTTP method
I configured custom data for the Web request body
{
"text": " '{{page.title}}' {{page.url}} has been published."
}
And here’s what it looks like in Google Chat!
Hope this helps anyone else looking to customize page titles with dates when creating with Automation, or anyone looking for how to send notifications to Google Chat.
Laura Campbell
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.
2 comments