updating a confluence page using ansible:

Keith Jamieson
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!
October 30, 2023

In the ansible builtin uri  module I have the following:

body_format: json

body: {"projects":[ {"Test Update"}]}

 

And I get a message "Must supply an  incremented version when updating content: N version supplied". 

So the question is  where do I specify the version? 

(I am aware I need to increment the version but for now I just want to supply an incremented version 

 

 

1 answer

0 votes
Keith Jamieson
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!
October 30, 2023

Ok  I have managed to almost get this to work so this is my json body which I am sending via the ansible.builtin.uri module.   The initial error was bad request but seemed okay once I moved the version  to where it is now. 

Then I was getting an error message saying you cannot chnage the space of an existing page. 

I was putting the page name in instead of the page key. Once I listed pages in confluence I could see the key for my space.  

 

Now I am getting the error: HTTP 103: Forbidden so will need to chase the confluence admins.  But I think the syntax is correct. 

 

body: 

{ "id": <page number>,

"type": "page",

"title": "My Title",

"space": { "key":"<Key for Space Name>" },

"version":{

  "number": version+1

             },

"body": {

  "storage": { 

    "value": "Modify the page",

   "representation":"storage"

                }

           }

}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events