Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I rename a confluence page using the api?

ssbaker
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!
June 25, 2020

Try as I might, I can't find this in the docs. I have a series of pages that I would like to rename. There are hundreds, and what needs to be done (remove the last word in the title) is very simple, so I was hoping to automate it.

What is the secret?

1 answer

1 accepted

0 votes
Answer accepted
ssbaker
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!
June 29, 2020

Found it! I kept seeing the process for updating content and glossing it over because I wasn't thinking of the title as content...

Dominic Lagger
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.
September 30, 2020

can you share how you did it? 
I'm stuck with the same problem now...

Thanks

Nick
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!
December 9, 2021

I use atlassian-python-api to manipulate Confluence pages, here is my example for page moving to another parent with renaming, you can use my idea to understand how it works:

 

# Old page title
old_title
= 'Beautiful Page Title'

# Title that you want to change to
new_title
= f"Much More {old_title}"

# Title of parent page where you want to move page to
parent_title
= 'New Home'

# Get ID for new parent page
parent_id = confluence.get_page_id(space=space, title=parent_title)

# Get old page contents
old_page_content = confluence.get_page_by_title(space=space, title=old_title, expand='body') # Old page contents

# Rename and move page, get updated content
new_page_content = confluence.update_page(old_page_content['id'], title=new_title, body=old_page_content['body'], parent_id=parent_id, type="page", representation="storage")

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events