I am not sure if atlassian allows this post, we will see.
are there freelancers available, who can help us with some automation rules?
it is mostly about pages which need to be altered (replace values) or add something to a pagetree and keep the prefix.
example pagetree:
project type 1
* OE-1 project one
** OE-1 status report
* OE-5 project space aliens
** OE-5 status report
I also have setup a freelancer campaign 455037908
Hi Patrick,
I have worked on similar Confluence automations using REST API and Forge custom apps.
Handling pagetree modifications and dynamic prefix updates is pretty straightforward.
Let me know the specifics and I can take a look.
You can reach out to me on my email here
Colin
Try this
📌 Use Case: Replace values across a pagetree
🔁 Step-by-step logic (in pseudo-code / scriptable logic):
✅ Sample Python Snippet using REST API:
import requests
import json
BASE_URL = "https://<your-instance>.atlassian.net/wiki"
AUTH = ("your-email", "your-api-token")
def get_child_pages(parent_id):
url = f"{BASE_URL}/rest/api/content/{parent_id}/child/page?limit=100"
response = requests.get(url, auth=AUTH)
return response.json().get('results', [])
def update_page_content(page_id, title, new_body, version):
url = f"{BASE_URL}/rest/api/content/{page_id}"
payload = {
"id": page_id,
"type": "page",
"title": title,
"version": {"number": version + 1},
"body": {
"storage": {
"value": new_body,
"representation": "storage"
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, auth=AUTH, headers=headers, data=json.dumps(payload))
print(f"Updated: {title} (Status: {response.status_code})")
def process_pages(parent_id):
pages = get_child_pages(parent_id)
for page in pages:
page_id = page['id']
title = page['title']
version = page['version']['number']
body_url = f"{BASE_URL}/rest/api/content/{page_id}?expand=body.storage,version"
content = requests.get(body_url, auth=AUTH).json()
body = content['body']['storage']['value']
# Replace content logic here
new_body = body.replace("OldValue", "NewValue")
if new_body != body:
update_page_content(page_id, title, new_body, version)
# Example usage
process_pages("<PARENT_PAGE_ID>")
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.