Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation (Confluence): How to generate a list of pages and email the list?

P. Bryan Edge-Salois August 3, 2023

Hello! Hoping someone here can help me with this automation.

Objective: I am trying to create an automation that will generate a list of Confluence pages based on a CQL query and then email the list of pages (in a single email) to me.

The Challenge: The part I'm having trouble with is getting the automation to output the CQL query results into a single list/email. Note: The email method *does work* if I use a "For Each" branch -- but then I get 100 emails, each with a page title and link. :/ 

The Deets: My basic automation is as follows:

  1. Trigger - Schedule
  2. For Related Entities (CQL parameters/search)
  3. Action - Send Email 

This works fine outputting to the Audit Log -- but it's ugly and still requires a lot of work to make it more usable/actionable. I haven't figure out a way to get it all in a single email.

Does anyone have suggestions or know how to make this work? 

Thanks in advance! :) 

5 answers

2 votes
Dylan Soechting
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 4, 2023

Hello @P. Bryan Edge-Salois

Branches do not support aggregating data for a single action like you are trying to accomplish here. However, @Bill Sheboy is correct that going with a manual web request to the Confluence API could enable you to accomplish your desired outcome.

I used the Search content by CQL endpoint to find pages by CQL query. Then I followed up in the Send email action with the Multi-user picker smart values to use the fields from a list to put together an email body with the page title and page URL. I did need to hard code the base URL value in the email action. I will attach some screenshots that I hope will help.

image.pngimage.png

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 4, 2023

Hey @Dylan Soechting -

How about we make this into a feature request (NOTE to anyone discovering this page later THIS IS NOT DOCUMENTATION, this is a FEATURE REQUEST):

Lookup content

Search for up to 100 pieces of content using a CQL query. Include the results list in other actions by using the {{lookupContent}} smart value. Learn more about using smart values with issue lists.

All properties can be accessed from the lookupContent list. For example, to print the titles and links for each page in bullet point form:

{{#lookupContent}}{{title}}: {{url}}
{{/}}

(Yes, there's the question of whether content is a page or blogpost, although I think blogposts can have titles too.)

I mean, you have {{cqlResult}}, so the data is there. You just need to make it into an iterable list.

Thanks!!

Like P. Bryan Edge-Salois likes this
Avinoam
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 7, 2023

Hi @Darryl Lee ! You're totally right :) This is something we have in our backlog to address within Confluence, and we'll be sure to post public updates once this is supported!

Like # people like this
P. Bryan Edge-Salois August 17, 2023

Yes -- this is a vastly over-complicated workaround for a very simple action: Isolate content by ancestor or parent, evaluate the created/modified dates, and output a list to a log or in an email. 

This is very simple functionality that should be easy to build.

Erin Manuel October 4, 2024

@Avinoam Is there a link to this feature request? Have there been any updates on this? And where can you find public updates?

0 votes
Erin Manuel October 4, 2024

@P. Bryan Edge-Salois, did you find a solution to this? I need something similar in my Confluence instance and have been wracking my brain to figure it out.

Levente Szabo _Midori_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 31, 2024

@Erin Manuel Automation for Confluence has improved since this thread was started, but it is still pretty complicated and does not fit scaled content lifecycle management for everyone. On top of everything, all the good stuff is only available for Premium and up which makes it pretty costly.

Better Content Archiving and Analytics makes creating custom Confluence notification automation easy. You can control:

  1. the email content (list of pages defined by CQL)
  2. email schedule (1 email per recipient, no email flooding)
  3. and recipients (including page owners)
  4. plus it's available on all tiers.

Watch how:

Don't overpay for Confluence Premium

If you need dedicated content lifecycle management features and automation, you are better off staying on Standard and getting Better Content Archiving and Analytics.

See an example calculation on how much $ you can save.

That is, unless you need the other stuff that's coming with Premium. Even in that case, the app is a dedicated tool for Confluence content lifecycle management, and not a general-purpose automation tool.

Start a free trial and feel free to reach out to us to discuss your use case or if you need help implementing a strategy.

(Please note that I'm part of the team at Midori, developing Better Content Archiving and Analytics since 2008.)

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 31, 2024

@Erin Manuel 

If you're trying to do what @P. Bryan Edge-Salois originally requested:

Objective: I am trying to create an automation that will generate a list of Confluence pages based on a CQL query and then email the list of pages (in a single email) to me.

Then I have to agree with @Levente Szabo _Midori_ that their app is the only easy way to do this. (I mean if you had a server handy you could write a script to do this with APIs and such...)

However, as much as I love Midori and their product, this bums me out, because while @Dylan Soechting mentions that the "Lookup pages" action that was added in Dec 2023 (which I requested here back in Aug 2023 ), it doesn't support CQL. Booooo.

Screenshot 2024-10-31 at 10.58.48 AM.png

Gah. Soooo close. :-/

Like Levente Szabo _Midori_ likes this
Erin Manuel November 12, 2024

@Levente Szabo _Midori_ My team already uses Better Content Archiving to archive pages, content statuses, and better analytics. It is working well for those purposes.

I have other automation actions that I'd like to notify users about, but I don't want to flood their inboxes with individual emails.

Like Levente Szabo _Midori_ likes this
0 votes
Jacquelyn Gallegos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 9, 2024

Was there ever an update on this feature request? Do we have visibility on the feature request so we can look for any updates? 

Thank you!!!

0 votes
Dylan Soechting
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 10, 2024

@P. Bryan Edge-Salois Hello! I just wanted to circle back and make sure that you're aware that we have released a new action called "Lookup pages" which should make accomplishing your goal much easier. The action is very similar to the "Page branch", except instead of doing some action for every single page found, it will aggregate all of the results in a single smart value.

You can read a bit more about the action in this post.

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 3, 2023

Hi @P. Bryan Edge-Salois -- Welcome to the Atlassian Community!

First thing, I do not have Confluence automation rules in my site, so I am making a suggestion based on what I know of automation for Jira.  With that out of the way...

Your use case is similar to using a scheduled rule on Jira issues and wanting one email communication (rather than one for each issue returned by JQL).  For Jira Cloud, you could use "Lookup Issues"...there does not appear to be an equivalent for Confluence automation.

Instead I wonder: could you use a web request action to call the Confluence REST API, and then iterate over the response to list the pages in a single email?

Kind regards,
Bill

P. Bryan Edge-Salois August 4, 2023

It's an interesting avenue to look into! Thank you! 

One would think this sort of functionality would be easier to build with standard tools... 

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events