Forums

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

How to export the results of Macro Usage to a .csv

Louise Simonds August 14, 2020

I need to generate a list of all pages on which a certain macro is used (LucidChart).  I can do this in the Administration UI with Macro Usage, but I've got hundreds of pages using the macro, and the UI isn't that easy to work with for a large number of pages.

How can I export the results of this into a form that is easier to work with - ideally a .csv that I can turn into a spreadsheet that I can sort, etc.?

Thanks very much

Louise

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.
August 21, 2020

Hi @Louise Simonds 

Do you mean this "macro usage"? 

image.png

If yes, here you only see how many times a macro was used. 

Or do you want a list of all pages which uses a special macro? 
Perhaps you can share an example of the head row in the .csv (what you would like to have)

Regards, Dominic

Louise Simonds August 24, 2020

Sorry - thought I replied, but now I don't see what I wrote.....

Thanks very much for your response. 

Yes - I mean the "macro usage" in your screenshot.   Specifically for LucidChart macro, but something general-purpose where I could specify the name of the macro would be ideal.

Columns I need in the .csv are:

space_name, space_key, page_id, page_title, page_url

where page_url can be used in a browser.

Extra credit for including last modified_by, last_modified_date

 I need this to identify pages using the LucidChart macro, because we are migrating our Confluence content to a new instance (Cloud to Server, after an acquisition) and LucidChart does not support that migration path.  The prospect of manually fixing all those links is daunting enough, and is nearly impossible unless we know which pages need fixing.

 

Thanks

Louise

Louise Simonds August 24, 2020

And yes - you are correct that the page in your screenshot lists only the number of times the macro is used, but if you click on that, you get a list of the pages.   Unfortunately, I cannot find a way to export those results, and the UI is not friendly - especially when I have nearly 400 pages with the LucidChart macro!

 

L

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.
August 25, 2020

Hi @Louise Simonds 

There are two possible solutions:

  1. REST API and parse the JSON
  2. Own User Macro

REST API

In the REST documentation you can see, that you can search with a CQL: Content Search

Which means, you can search with:

<<URL>>/rest/api/content/search?cql=macro+%3D+%22LucidChart%22&limit=1000

This gives you 500 (max is 500) pages. You can create a second call with the "start" parameter:

<<URL>>/rest/api/content/search?cql=macro+%3D+%22LucidChart%22&limit=1000&start=500

This gives you the results from 500.

From there you can generate a CSV with  a converter like https://json-csv.com/

User Macro

You could possibly write an user macro. But I want to see if the first option is okay for you, before we look to deep in the user macro option.

Regards, Dominic

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