Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Need SQL Query which can pull list of all pages from confluence which are using external gadgets

Need SQL Query which can pull list of all pages from confluence which are using external gadgets:

we got a requirement to update external gadgets poining URL from old to new, we did by using following suggested procedure 

https://confluence.atlassian.com/confkb/how-to-change-urls-of-external-gadgets-296913316.html 

Now to validate the result we need SQL Query result based on that we access random pages in which gadgets are using and will confirm the customers.

 

 

1 answer

0 votes
Dominic Lagger Community Leader Dec 09, 2021

Hi @Sriram Pallapothu 

Just search all bodycontent for your URL

select * from bodycontent where body like '%google%'

There you find the contentID and with that you can open the page.

Regards, Dominic

Hi Dominic.

 Thanks for your help but this did not worked for my requirement.

actually I updated the URL by using update query: 

update BODYCONTENT
set body = replace(body, 'http://test.com:8080', 'http://newtest.com/jira')
where body like '%http://test.com:8080%';

Now I need to view which confluence pages are using these external gadgets and need to check they are working fine as expected. 

 

For example: this is gadget I updated, now i need to view in which confluence pages using "admin-gadget.xml" 

select count(*) from BODYCONTENT where BODY like "%http://jira.td.com/jira/rest/gadgets/1.0/g/com.atlassian.jira.gadgets:admin-gadget/gadgets/admin-gadget.xml%";

for validating all the changes please suggest the query to view which confluence pages using that particular gadgets.

 

Regards,

Sriram

Dominic Lagger Community Leader Dec 12, 2021

Hi @Sriram Pallapothu 

Sorry, but I don't know what part is missing...

This select statement will get you ALL pages, where this gadget occurs.

select * from bodycontent where body like '%GADGET HERE%'

In the table of results, you will find a CONTENTID. This contentid you have to use to open the page.

https://CONFLUENCE-URL/pages/viewpage.action?pageId=CONTENTID

Regards, Dominic

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence Cloud

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

43,307 views 32 134
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you