atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

[Confluence] better documentation required

Open DawidKrysiak opened this issue 1 year ago • 6 comments

calling the update update = confluence.update_page( parent_id=None, page_id=page_id, title=title, body=page_content )

returns with:

No space or no content type, or setup a wrong version type set to content, or status param is not draft and status content is current

so further params are needed for successful operation - none given in the documentation.

DawidKrysiak avatar Jul 16 '22 11:07 DawidKrysiak

You should use a Editor which is aware of the inline documentation.

Spacetown avatar Jul 16 '22 12:07 Spacetown

Hi, Not sure the intent of the remark. Inline documentation in your code? I looked at the code, tried to populate all switches - no avail. Usual issues reported a thousand times (missing content type etc...) Tried to tinker with all possible combinations -page update to page type 'wiki' using recommended 'representation=storage' will paste the text with all formatting (either html or atlassian wiki formatting) as plain text? Using 'representation=wiki' will create a beautiful page, but... During the first attempt of editing it through the browser, atlassian will throw out errors stating it's not capable to convert the document to 'storage'.

DawidKrysiak avatar Jul 16 '22 13:07 DawidKrysiak

The arguments are documented inline (can be more 😄): https://github.com/atlassian-api/atlassian-python-api/blob/f14682a6b25f0b392bac672f7da1b2287751e1a2/atlassian/confluence.py#L1479-L1504

This is used for example in VS Code: Bildschirmfoto 2022-07-16 um 15 36 52

The used API, whiche returns you're error message, is documented here

Spacetown avatar Jul 16 '22 13:07 Spacetown

Hi when I choose representation='wiki' it works fine, but of course I have to use the markdown language that is missing many essential options. When I switch to 'storage', it either fails with "No space or no content type, or setup a wrong version type set to content, or status param is not draft and status content is current" or (sometimes when I use escape from html) posts a raw html code.

Kind regards Dawid

The arguments are documented inline (can be more 😄): https://github.com/atlassian-api/atlassian-python-api/blob/f14682a6b25f0b392bac672f7da1b2287751e1a2/atlassian/confluence.py#L1479-L1504

This is used for example in VS Code: Bildschirmfoto 2022-07-16 um 15 36 52

The used API, whiche returns you're error message, is documented here

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

DawidKrysiak avatar Jul 18 '22 17:07 DawidKrysiak

Hi @DawidKrysiak , I will be happy if you provide PR related to the docs, because sometimes I forgot to extend the docs. That's my bad,

gonchik avatar Sep 18 '22 12:09 gonchik

The problem is with escaping. Somewhere in your content is an & or something that the XML parser doesn't like. I ran into this issue first with &, but have now hit the same issue when using parentheses in the jqlQuery argument for XML macros in the Confluence pages.

The raw source from the UI shows "Hello (World)" as does my template, but if I try and update the template it fails. Updating the "raw" source in the UI works.

joestump avatar Oct 16 '23 19:10 joestump