{"id":4632,"date":"2012-03-05T14:25:00","date_gmt":"2012-03-05T14:25:00","guid":{"rendered":""},"modified":"2026-04-18T22:48:59","modified_gmt":"2026-04-18T22:48:59","slug":"create-a-blog-post-in-confluence-using-groovy","status":"publish","type":"post","link":"https:\/\/hellem.org\/wblog\/?p=4632","title":{"rendered":"Create a blog post in Confluence using Groovy"},"content":{"rendered":"<p>Needed a way to publish a file containing a list of application versions installed in our WebSphere environment. What better to use than Groovy and XML-RPC for Atlassian Confluence. Tested on version 3.5<\/p>\n<p><!-- codeblock lang=\"\" line=\"1\" --><\/p>\n<pre><code>\r\nimport groovy.net.xmlrpc.*\r\n\r\n\/\/ ************** Set according to your environment ********\r\ndef SERVER = \"http:\/\/&lt;YOUR_SERVER_NAME&gt;\/rpc\/xmlrpc\"\r\ndef UID = \"&lt;UID&gt;\"\r\ndef PWD = \"&lt;PWD&gt;\"\r\ndef SPACEKEY = \"&lt;SPACEKEY&gt;\"\r\ndef BLOGTITLE = \"&lt;BLOGTITLE&gt;\"\r\ndef CONTENTTXT = \"&lt;TEXT WITH MACROS AND SUCH&gt;\"\r\n\/\/ *******************************************************\r\n\r\nprintln \"Connect to server\"\r\ndef c = new XMLRPCServerProxy(SERVER)\r\n\r\nprintln \"Login to server\"\r\ndef token = c.confluence1.login(UID,PWD)\r\n\r\n\/\/ Example found at http:\/\/confluence.atlassian.com\/display\/DISC\/XML-RPC+Page+Updater+Example\r\nprintln \"Create blog and then save it\"\r\ndef newBlogdata = [space:SPACEKEY,title:BLOGTITLE,content:CONTENTTXT]\r\nc.confluence1.storeBlogEntry(token, newBlogdata)\r\n\r\n\/\/ Clean up by logging out\r\nprintln \"Logout\"\r\nc.confluence1.logout(token)\r\n<\/code><\/pre>\n<p><!-- \/codeblock --><\/p>\n<p><strong>Update:<\/strong><br \/>\nIn additon you would off course need to download the needed jar file, get it at http:\/\/groovy.codehaus.org\/XMLRPC<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Needed a way to publish a file containing a list of application versions installed in our WebSphere environment. What better to use than Groovy and XML-RPC for Atlassian Confluence. Tested on version 3.5 import groovy.net.xmlrpc.* \/\/ ************** Set according to your environment ******** def SERVER = &#8220;http:\/\/&lt;YOUR_SERVER_NAME&gt;\/rpc\/xmlrpc&#8221; def UID = &#8220;&lt;UID&gt;&#8221; def PWD = &#8220;&lt;PWD&gt;&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"class_list":["post-4632","post","type-post","status-publish","format-standard","hentry","category-work-geek"],"_links":{"self":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4632"}],"version-history":[{"count":1,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4632\/revisions"}],"predecessor-version":[{"id":12971,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4632\/revisions\/12971"}],"wp:attachment":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}