Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to find broken macros including specific space key?

ryder
Contributor
April 22, 2020

Hello,

we are using a confluence cloud instance and have to spaces.

One of theses spaces must be copied and will get a new space key.

The other space uses macros like "include page" and in the macro configuration is the space key used to link the right page. Now, when the space key will be changed, how can I find the pages where macros like include page, excerpt etc. are used and are now broken?

 

Any hints?

Wishes

Thorsten

1 answer

1 accepted

0 votes
Answer accepted
Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2020

Hi @ryder 

There are two options:

  1. Go to the confluence settings and choose "Macro Usage". There you can click on the macro and you will be redirected to the search. 
    https://<<yourinstance>>.atlassian.net/wiki/admin/pluginusage.action 
  2. Go to the search and type: 
    macroName:excerpt-include*
    https://<<yourinstance>>.atlassian.net/wiki/dosearchsite.action?cql=siteSearch+~+%22macroName%3Aexcerpt-include*%22

Hope this helps

Regards, Dominic

ryder
Contributor
April 26, 2020

@Dominic Lagger 

I'm not sure, if I get this right.

I have plenty uses of e.g. excerpt-include. When I use excerpt-include it might be possible that the macro hat a space key konfigured for getting the right page.

So I want all page which uses excerpt-include referencing to page using the space key ABCD.

I did not understand in your example to shrink the search in uses of excerpt-include which includes the space key ABCD?

Is this anyhow possible?

Thanks, in advanced.

ciao

Thorsten

Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2020

oh okay, you want also to search the parameters of the macro.

I found an article on the web and tried it. It works, but I get too much search results... 

In confluence 4, there was the possibility to search with "wikimarkup" terms. This looked like this: 

wikiMarkup:"excerpt-include:Introduction to chocolate"

This searches all the "excerpt-include" macros with a connection to the page "Introduction to chocolate"

For your case, it must be

wikiMarkup:"excerpt-include:SPACEKEY"

But as I said, I got to much results, even results, without having an excerpt-include macro. 

Do you have access to the database? Perhaps there you could make an SQL:

select * from content, bodycontent 
where bodycontent.contentId = content.contentId and body like '%excerpt-include:SPACEKEY%'

 Regards, Dominic

ryder
Contributor
April 26, 2020

@Dominic Lagger ,

yes, I have the same problem, I see also pages without the macro.

And no, I do not have SQL access. Only CLI. But I did not find a solution using CLI and I did not find a solution using wikimarkup search terms. This was the reason for this post.

 

Regards,

Thorsten

Michael Kuhl {Appfire}
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2020

Hi @ryder - You mentioned you have the CLI.  I assume you are referring to the Bob Swift Confluence CLI.

If so, you can solve this problem in one action using the copySpace action with the findReplace option.  Here's an example of how you might do this:

acli --action copySpace --space "OLDSPACEKEY" --newSpace "NEWSPACEKEY" --findReplace "OLDSPACEKEY:NEWSPACEKEY"

This action will copy of all of the content from OLDSPACE to NEWSPACE, replacing the space keys in the page content in the process.

 

By the way: I'm the product manager for the Bob Swift CLI product line.

Like Dominic Lagger likes this
ryder
Contributor
April 27, 2020

Hi Michael,

thanks for your answer. It works, really great. It takes some time and need some extra copying, but it works fantastic!

 

Regards,

Thorsten

Like Dominic Lagger likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events