It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to update a page from python?

I've got a functional testing daemon that verifies the status of a specific environment. I would like it to programmatically update a confluence page with the results of the test, each time the test is run. Is that possible?

If so, then how can I do it in Python?

And, if not in Python, is there an example in Java that I can use as a starting point?

2 answers

1 accepted

4 votes
Answer accepted

There are plenty of examples, just google for it, anyway - here is one

import xmlrpclib

CONFLUENCE_URL='http://localhost:8280/wiki/rpc/xmlrpc'
client = xmlrpclib.Server(CONFLUENCE_URL,verbose=0)
authToken=client.confluence2.login(CONFLUENCE_LOGIN,CONFLUENCE_PASSWORD)

page = client.confluence2.getPage(authToken, pageid)
page['content'] = newcontent
client.confluence2.storePage(authToken, page)
client.confluence2.logout(authToken)

Confluence Command Line Interface has the storePage action. Construct a command string and run :).

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted 9 hours ago in Jira

Upcoming Enterprise releases targeting Q3 2019: Jira Software 8.5 & Jira Service Desk 4.5

Since launching the Jira Software 8.0 and Jira Service Desk 4.0 platform releases in February, many of you have been asking when the next Enterprise release will be so you can take advantage of the m...

181 views 0 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you