comment count by space

Dear all, 

Would it be possible to count comment by space list, such as the address : https://drive.google.com/file/d/0BxriXuT0xeaFLWlUM2J5MzQwZjQ/view?usp=sharing

Thank you.

1 answer

0 vote
Stephen Deutsch Community Champion Oct 10, 2015

There's probably a way using the database, but I know the API better, so here's a method using that.  Just paste the following code in your browser console and you'll get a comma separated list smile

jQuery.ajax({
    contentType: "application/json",
    type: "POST",
    url: contextPath + "/rpc/json-rpc/confluenceservice-v1/getSpaces",
    success: function( response ) {
        jQuery(response).each(function() {
            var space = this;
            jQuery.ajax({
                url: contextPath + "/rest/searchv3/1.0/search?type=comment&where=" + space.key,
                success: function(results) {
                    console.log(results.total + ", " + space.name + ", " + space.key);
                }
            });
        });
    }
});

But I tried add these code as listed as above by html macro, it does not show anything. How can we separate the list by month /week? Thank you.

Stephen Deutsch Community Champion Oct 11, 2015

It doesn't run in the HTML macro, you have to copy/paste it into the browser console (usually pulled up by pressing F12). As for listing by month/week, what did you have in mind? all months/weeks in 2015? you have to run a separate query for each space and for each week/month, so let me know.

Dear Stephen , 

Thank you for your kindly assistance.

Just make sure how can we execute the code as listed as above , because we have pasted the code into google chrome browser and then how can we run it ? Thank you.

comment.jpg

Stephen Deutsch Community Champion May 22, 2016

You should just be able to press Enter and it should run smile

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,694 views 26 10
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you