Open hkelley opened 1 year ago
The feature could be easily included just by adding 1 line of code:
(based on ConfluencePS 2.5.1 module, ConfluencePS.psm1) (valid for the "byObject" ParameterSetName, i.e. piping the page to the cmdlet, or passing the page as -InputObject)
Before
function Set-Page {
...
switch ($PsCmdlet.ParameterSetName) {
"byObject" {
$iwParameters["Uri"] = $resourceApi -f $InputObject.ID
$Content.version.number = ++$InputObject.Version.Number
$Content.title = $InputObject.Title
$Content.body.storage.value = $InputObject.Body
After
function Set-Page {
...
switch ($PsCmdlet.ParameterSetName) {
"byObject" {
$iwParameters["Uri"] = $resourceApi -f $InputObject.ID
$Content.version.number = ++$InputObject.Version.Number
$Content.version.message = $InputObject.Version.Message # THIS LINE
$Content.title = $InputObject.Title
$Content.body.storage.value = $InputObject.Body
Usage example:
$page = Get-ConfluencePage -PageID $pageId
$page.Body = ...
$page.Version.Message = "Updated by Octopus Deploy on $utcNow, deployed by $operatorName"
$page | Set-ConfluencePage
Locally patching the module (search for it on PSModulePath) leads to the desired result:
Could this be implemented? This is super useful for automated content updates. Thank you Jose.
I saw the older issue #22 which seems to have been closed pending some API enhancements. From what I can see today, this method,
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content/#api-wiki-rest-api-content-id-put
accepts a version object with a
message
property. Can this request be incorporated now?