Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using UpdateAsync doesn't work well, am I doing it wrong? #51

Open
Bugzuki opened this issue May 12, 2021 · 1 comment
Open

Using UpdateAsync doesn't work well, am I doing it wrong? #51

Bugzuki opened this issue May 12, 2021 · 1 comment

Comments

@Bugzuki
Copy link

Bugzuki commented May 12, 2021

In order to get the UpdateAsync method to be accepted by Visual Studios I had to build and use a Content variable as follows:

Content content = confluenceClient.Content.GetAsync(contentDigest.Id).Result;
String bodyViewValue = content.Body.View.Value;

content.Body.View.Value = PageBody; //Page Body is an string variable with HTML text in it
content.Version.Number++;
content.Version.When = DateTimeOffset.Now;
content.Version.IsMinorEdit = true;
content.Version.Message = "New Revision of the Document";

confluenceClient.Content.UpdateAsync(content).Wait();

Once I do that it will run, but it does not publish the content to the edited page.
And looking at the page edits does not show any changes that should be there.

Also the Version.Message is blank.

Am I building the method call correctly?
How do I get it to publish the page?

I got the functions to delete the existing page and then creating the new page to work, but I don't want to lose the page history.

@Bugzuki Bugzuki changed the title Using UpdateAsync doesn't work well Using UpdateAsync doesn't work well, am I doing it wrong? May 17, 2021
@dostjh
Copy link

dostjh commented Dec 14, 2022

I believe you'll want to use content.Body.View.Storage instead of content.Body.View.Value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants