Can you search by macro attribute in Confluence 5.2.5?

Jon Bell January 2, 2014

I have several pages that us the My Picture Macro with usernames. Is there a way I can search for all instances of a particular macro that use a username?

In earlier Confluence versions I was able to search "{my-picture:abc}"

Example: on 3 unknown pages I have "My Picture Macro | username = abc"

username = abc no longer uses Confluence and I need to find and remove My Picture Macro | username = abc on those three pages.

Using Atlassian Confluence 5.2.5

4 answers

1 accepted

0 votes
Answer accepted
Jon Bell January 19, 2014

There does not appear to be anyway to search for a macro content using the search bar.

1 vote
Davin Studer
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.
January 20, 2014

Not sure if this will work with 5.2.5. I have 5.1.3 and it still works though. This plugin gives you search syntax to search macro parameters. The bottom link is an article on how to do the search syntax.

https://marketplace.atlassian.com/plugins/com.atlassian.confluence.plugins.confluence-macro-indexer-plugin

http://ffeathers.wordpress.com/2012/09/04/how-to-search-for-macros-and-macro-parameters-in-confluence-4/

1 vote
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
January 2, 2014

Searching for macros in the documentation.

Jon Bell January 3, 2014

Thanks Bob,

That shows how to search for the macro, however, I am trying to find the macro by attribute, in this case user abc

If I use macroName: my-picture* then it will return all instances of said macro. I am specifically looking for the linking to username=abc

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
January 3, 2014

I don't know of a way to do that without going to SQL on the content in the database. Look at the storage view of the example you have and construct a matching query on the content. Something like:

select * from content, bodycontent 
where bodycontent.contentId = content.contentId and body ilike '%xxx%'

You probably need to get the latest version of the content as well.

0 votes
Matthew J. Horn
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.
January 19, 2014

You might be able to use the MacroMetadataManager to search the attributes of user macros. I haven't tried this, but have documented how to use this class in searches:

https://answers.atlassian.com/questions/62513/is-there-a-macro-which-highlights-on-which-pages-a-user-macro-is-in-use-in-confluence

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events