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

Automate page creation with hierarchy and date-based labels.

Sushil Ranjan December 4, 2024

Hi,

We create two pages weekly, each containing the 'Page Properties Report' macro, and we want to automate this process. I have created a global template that includes the Page Properties Report macro, which can be used in the automation. However, I need assistance with the following requirements:

 

Requirement 1:

When the automation runs, the pages should be created under their respective parent pages.
For example:

  • Pages "Release 2024.12.03" and "Release 2024.12.04" should be created under the parent page 'Release 2024' > 'Release 2024.12'.
  • Next month, when the rule runs, pages "Release 2025.01.03" and "Release 2025.01.04" should be created under 'Release 2025' > 'Release 2025.01'.

The parent page "Release 2025" can be created manually, but the monthly and weekly pages need to be automated.

Requirement 2:

When the pages are published, the 'Page Properties Report' macro should automatically update the 'label' filters with the creation date of the page.
for eg:

 

  • If the page is created on January 3, 2025, the macro should use the label filter 20250103.
  • Similarly, for January 4, 2025, the label filter should be 20250104.

1 answer

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.
December 4, 2024

Hi @Sushil Ranjan 

What have you tried thus far to solve this need?

 

If you have an automation rule that is not working as expected, please post images of the complete rule and the audit log details, and explain what is not working as expected.  Those will provide context for the community to offer suggestions.

 

If you have not started a rule yet, I encourage you to try to do so.  The Atlassian Community is a place for people with related interests to learn and collaborate with one another.  It is not a free labor pool to implement requests upon demand.  If you regularly need help with rules, please work with your Jira Site Admin to learn more and seek their help.

To get you started on creating your rule, please refer to these documentation and example sources:

I recommend trying to implement the scenario you describe incrementally, testing as you go by initially writing the results to audit log rather than creating Confluence pages.  After the logic is working, change from logged messages to creating the pages.

 

Kind regards,
Bill

Sushil Ranjan December 6, 2024

Hi Bill,

As I mentioned, I have created a template that I call during the Page Publish. Basically I created two rules.
Rule1, Monthly Release Page: Publish a page monthly with title: Release 2024.12
image.png

Rule2, Weekly Release Page: Create a page weekly with title: Release Meeting 2024.12.dd
image.png

currently Rules are triggered manually, will switch it with scheduler later.

Need assistance on automating the weekly pages to be created as child pages under their respective monthly release page. At present, they are being created parallel to the Release 2024 page.

image.png
I have tried using Lookup Pages, Page Branching, and the Branch Rule / Related Entities with CQL, but it is not working as expected.

Second requirement is to edit the pages, I could not find an option to edit pages in the rules, might be achievable using the REST API or script, but I am new to using these. Any guidance or examples would be greatly appreciated.

Thanks,
Sushil

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.
December 6, 2024

Thank you for the additional information.

 

To dynamically set the parent page in the action, you could try creating a variable for the parent page name (based on the current date) and then entering the variable in the action.

If that action will not take a variable for the parent page, you will instead need to use the Send Web Request action to call the REST API endpoint for page creation.

 

For your second question, you are correct there is no automation action to "edit page", as that would likely be quite complex regarding formatting.  Instead, you could use the Send Web Request action to call the REST API endpoint to first get the page content, make changes to the returned content, and finally to make a second call to the edit page endpoint.  As the specifics of your content impact how to do this, you will likely need to experiment to get this to work as needed.

 

Here are some references that should help do this:

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events