Confluence API-获取父母的子页面也按日期范围过滤

发布于 2025-02-08 21:51:11 字数 544 浏览 0 评论 0 原文

我正在尝试从父页面上获取所有子页面,并尝试在日期之前获得过滤结果。

我正在尝试以下查询,但它丢弃了所有子页面,但并未在提供的日期范围内显示结果。

api端点:

https://domain-name.atlassian.net/wiki/wiki/wiki/rest/rest/content/content/content/search?cql = parent = parent = parent = 2342344 01-01%20和%20创建= 2022-01-01

在结果中,我看到了孩子页面,但我也看到了2021年之前创建的页面

I am trying to get all the child pages from the parent page and also trying to get the filtered results by the date.

I am trying the following query but it is throwing all the child pages but it is not showing the results within the provided date range.

API endpoint:

https://domain-name.atlassian.net/wiki/rest/api/content/search?cql=parent=2342344&created=2021-01-01%20and%20created=2022-01-01

In the results, I am seeing the child pages but I am also seeing the pages created before 2021

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌能量女王 2025-02-15 21:51:11

您的查询几乎是对的,您只需使用< > 即可过滤日期。

例如,以下(Python)请求对我有用:

response = requests.get(
    url="https://jira.<my domain>.com/confu/rest/api/content/search",
    params={
        "cql": "parent=2342344 and created>2021-01-01 and created<2022-12-11"
    },
    headers={"Authorization": "Basic <token>"}
)

只需确保您的URL编码正确即可。编码,它应该看起来像:

/concu/rest/api/content/搜索?

您可以在此处找到文档: https://developer.atlassian.com /server/Confluence/Advanced-Searching-使用CQL/

Your query is almost right, you just have to use < and > to filter your dates.

For example, the following (Python) request works for me:

response = requests.get(
    url="https://jira.<my domain>.com/confu/rest/api/content/search",
    params={
        "cql": "parent=2342344 and created>2021-01-01 and created<2022-12-11"
    },
    headers={"Authorization": "Basic <token>"}
)

Just make sure your URL encoding is correct. Encoded, it should look like:

/confu/rest/api/content/search?cql=parent%3D207377670%20and%20created%3E2021-01-01%20and%20created%3C2022-12-11

You can find documentation here: https://developer.atlassian.com/server/confluence/advanced-searching-using-cql/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文