Comments (2)
Do you want to get storage format of each returned page returned by cql? If so this won' work with this single api call:
test = confleunce_cloud.cql(cql='space = "TEST"', limit=25, expand='content.body.storage')
json = json.dumps(test, indent=4)
print(json)
you will get something like:
"results": [
{
"content": {
"id": "448972356",
"type": "page",
"status": "current",
"title": "test",
"macroRenderedOutput": {},
"body": {
"storage": {
"value": "test",
"representation": "storage",
"embeddedContent": [],
"_expandable": {
"content": "/rest/api/content/448972356"
}
},
"_expandable": {
"editor": "",
"atlas_doc_format": "",
"view": "",
"export_view": "",
"styled_view": "",
"dynamic": "",
"editor2": "",
"anonymous_export_view": ""
}
As you can see body.storage. doesn't include any valuable information returned by the API.
However, you can try doing something like this instead:
import json
test = confleunce_cloud.cql(cql=' type=page AND title ~ "test"', limit=25)
for issue in test['results']:
page_storage_form = confleunce_cloud.get_page_by_id(issue['content']['id'], expand='body.storage')
print(page_storage_form['body']['storage']['value'])
this will return all the storage formats from pages returned by cql. Let me know if this works.
from atlassian-python-api.
Thank you for your response. I have encountered a challenge while attempting to retrieve all pages using the start and limit parameters. Unfortunately, the current implementation does not seem to be working as expected, as I keep receiving the same pages in each iteration. It appears that the start parameter is not functioning correctly.
Code Snippet:
res = []
start = 0
limit = 5
while True:
test = confluence.cql(cql='space = "TEST" and type = page', start=start, limit=limit, expand='content.body.storage')
test = test.get("results", [])
res.extend(test)
if len(test) < 5:
break
start += limit
print(len(res))
Could you please help me identify the issue and provide guidance on how to correctly use the start parameter to fetch all pages? Your assistance is greatly appreciated.
from atlassian-python-api.
Related Issues (20)
- need a function to set the test status in in test execution HOT 1
- Confluence Cloud Python API connection Timeouts
- Jira Software - rank API available? HOT 1
- [Jira] get_issue_changelog broken? HOT 2
- unexpected keyword argument 'paging_workaround' HOT 6
- Insight (Assets) class not correctly setting self.default_headers when cloud=True HOT 1
- [Confluence] Attachments - get_attachments_from_content HOT 1
- Bad Request for pullrequests with page params HOT 1
- bitbucket.project_list() only returns generators HOT 3
- Export page not working HOT 1
- Add label parameter to get_all_spaces method HOT 2
- pylint missing from requirements-dev.txt
- Edit issue not respect documentation
- Reading large confluence page
- export_page is giving 404 error
- Grammar and URL error on get_page_id
- black formatting in multiple versions of python HOT 3
- New release HOT 2
- confluence.add_user_to_group is wrong HOT 2
- [Jira] "Agile" methods don't use the “api_root” instance attribute, as most other methods do HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atlassian-python-api.