Hello,
When I use a GET request to find a page by looking for its title, the call will also look for the page in the recycle bin. How do I prevent this? To visualize this issue a little bit better:
Lets say we have a page called foobar. I have a Jira automation rule that checks if the page foobar exists. If it does not exists, it will create the page. We run the automation rule and the page exsits, thus nothing is created. Now lets say that someone accidentally, manually, deleted the page foobar. Once the rule is executed it will look for foobar. It finds foobar, in the recycle bin. It thinks the page foobar exists and it is not created. Yes it exists, but its not live for the world to see.
My question is, is it possible for the GET request to NOT look into the recycle bin and only look for live pages?
Example code:
https://mybusiness.confluence.com/rest/api/content/search?cql=title=foobar
Hi @Ano Niempje
I think you can specify the status of the content, in your case set it at "current" to avoid "trashed" content
https://docs.atlassian.com/atlassian-confluence/REST/6.6.0/#content-getContent
Regards,
Hi Cyrille thanks for your reply. I tried this for a custom body:
But it still looks into the trash. Any idea why that is?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI. We have two environments. One for development and one for production. If I execute this in development, it works. When I execute this is production, it doesn't work.
I run this in production, using status current as its body and it gives me results such as the page title, the body, the ID etcetera. So when I copy that ID like this:
https://confluence.mycompany.nl/spaces/mySpace/pages/2769289397
It redirects me to a page that says:
Page has been deleted but you can find it in the recycle bin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And one last thing, the api result says status:current even though the page is in the trash.
Like this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You may have an issue on your content indexation.
I know it is not the best to rebuild an index on production environment during the day but depending on the size of the space where your trash page is present, you can only re-index this space ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Cyrille, not sure how I do this but I guess this is something I will have to discuss with the Administrator. I did some aditional testing and tried to look for my live page but it keeps giving me a page with an ID that does no longer exists anymore (not even in the trash) so I am suspecting that it still is looking for my previously deleted page somewhere in the database? Funny thing is that when I run the GET request form a Jira automation rool webhook action I get the wrong page, but when I run the GET request from Postman I get the live and correct page, every time.
Thanks for your input Cyrille I think the best thing I can do now is contact my Atlassian administrator.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.