Code Monkey home page Code Monkey logo

Comments (9)

gonchik avatar gonchik commented on May 26, 2024 2

@kierun Well, you can do in different ways i.e.
old_content = confluence.get_page_by_id(123).expand='storage.view' body = (((result.get('body') or {}).get('view') or {}).get('value') or {}) body.replace("oldvalue", "new_value") confluence.updade_page(old_content.get('id'), body=body)

https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/confluence.py#L505
https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/confluence.py#L541

from atlassian-python-api.

gonchik avatar gonchik commented on May 26, 2024

Hi!
I hope that commit will cover your request
1b875e8

Cheers,
Gonchik Tsymzhitov

from atlassian-python-api.

kierun avatar kierun commented on May 26, 2024

1b875e8 seems to be about appending to a page. As far as I understand @argysamo request, this is about getting the whole content of a page.

As simple use case would be:

  • Get the page's data.
  • Find some field within said data -- for example a page property.
  • Update said field to a new value.
  • Upload the new page content.

Or is that already possible and I somehow missed it?

from atlassian-python-api.

freeyland avatar freeyland commented on May 26, 2024

@gonchik When trying previous i am getting:
AttributeError: 'dict' object has no attribute 'expand'

from atlassian-python-api.

freeyland avatar freeyland commented on May 26, 2024

SHould be I think:
confluence.get_page_by_id(page_id, expand='storage.view')
But : 'bool' object has no attribute 'get'

from atlassian-python-api.

gonchik avatar gonchik commented on May 26, 2024

@freeyland on which did you try it?

from atlassian-python-api.

freeyland avatar freeyland commented on May 26, 2024

It is working, made a mistake in my code. Thnx for quick reply

from atlassian-python-api.

freeyland avatar freeyland commented on May 26, 2024

@gonchik When Updating Im getting:
{'statusCode': 400, 'message': 'org.codehaus.jackson.map.JsonMappingException: Instantiation of [simple type, class com.atlassian.confluence.api.model.content.id.ContentId] value failed: Can't parse as a ContentId:

Hallo

(through reference chain: com.atlassian.confluence.api.model.content.Content["ancestors"]->com.atlassian.confluence.api.model.content.Content["id"])'}
body.replace("Hallo", "Hallo2") result = confluence.update_page( parentID, pageID, 'Versions & Changelogs', body, 'page', 'wiki')

from atlassian-python-api.

gonchik avatar gonchik commented on May 26, 2024

Please, check the order of variables
https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/confluence.py#L687

from atlassian-python-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.