How can I decide the page has inline comment or not?

At this moment I go to a page, and sroll down it slowly (sometimes very slowly), and I search text with yellow background. In the page menu I can find resolved comments, but the unresolved is very important for me if I'm the page creator.

4 answers

1 vote
Stephen Deutsch Community Champion Sep 23, 2015

While it is not so easy to get that information, it is not impossible smile

While you are logged into Confluence and looking at any page, you should paste this code into the javascript console (accessed in your browser by pressing F12 or Ctrl/Cmd+Shift+i).

var getUnresolvedInlineComments = function(space, username, start) {
    start = start || 0;
    var spacePart = "";
    if (space) {
        spacePart = "space%3D" + space + "%20and%20"
    }
    jQuery.ajax({
        url: contextPath + "/rest/api/content/search?cql=" + spacePart + "type%3Dcomment&expand=extensions.resolution%2Ccontainer.history&start=" + start,
        success: function(response) {
            jQuery(response.results).each(function() {
                if (this.hasOwnProperty("extensions") && this.extensions.location === "inline" && this.extensions.resolution.status === "open" && (typeof(username)==="undefined" || this.container.history.createdBy.username === username)) {
                    console.log(AJS.params.baseUrl + this._links.webui);
                }
            });
            if ( !(response.size < response.limit) ) {
                getUnresolvedInlineComments(space, username, start + 25);
            } else {
                console.log("Done!");
            }
        }
    });
}

You then need to run the code by entering:

getUnresolvedInlineComments()

This will search for all unresolved comments on pages you have created in your entire Confluence instance.  Depending on how many comments you have in your system, this may take a while.  It will output "Done!" when finished.  The pages will be output to the browser console and you should be able to click on them (or copy/paste) to jump directly to the comment.

To look in another space, run it like this:

getUnresolvedInlineComments("ds")

This will search in the space with the space key "ds".  To search on pages created by another user, run it like this:

getUnresolvedInlineComments("", "username")

This will search all pages for unresolved comments on pages created by the user with the username of "username".  You could combine both of these as well:

getUnresolvedInlineComments("ds", "username")

This will search all pages in space "ds" created by the user with the username "username" for all unresolved comments.

This should work for both Cloud and Server.

EDIT: Updated the code to fix some issues, thinking about turning it into a real addon.

Unfortunately this returns also replies to inline comments that are already resolved: an inline comment reply has a status on its own, but it doesn't get resolved when the initial inline comment itself gets resolved. I tried to figure out a distinct property of those replies, but wasn't able to find one so far... Any idea?

@Stephen Deutsch 

This is a great way to identify unresolved comments, if using a server instance (and unable to try the suggested plugin). Is it possible to via javascript to filter the inline comments to only those where the parent comment is open?

I think it is a new feature requests here:

CONF-36602

CONF-34510

Hope this helps!!

And  CONF-36933 - Improve Inline Comments NEW  as well.  I recommend voting for these requests. 

.

0 votes
Stephen Deutsch Community Champion Oct 30, 2016

A Cloud addon was recently released that would help with this:

See All Unresolved Comments

Not only do you get a counter at the top to see how many unresolved inline comments are in a page, but you can also click to jump directly to the first comment. You can even search (run a report) to see all unresolved comments filtered by space and/or commenting user. For longer pages, there's also an overview report that shows just the headings and the commented text, so you can get a quick overview of what's on any particular page.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,151 views 20 14
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