Hi,
I have a bunch of watching pages and want to stop all. Is there a way for bulk execution of that, instead of opening each page and stop watching one by one?
Thanks,
Hello @Ryota Hashimoto , on top right corner --> Goto --> Profile --> Settings --> Watches --> From here you can click "Stop Watching" for any unwanted spaces or pages you like.You can also adjust your email notification options from your email settingshttps://yourinstancename/wiki/users/viewmyemailsettings.action page or goto --> your profile --> Settings --> Email --> Edit --> Turn off Autowatch
My original posting does not help as you are on cloud sorry.
Hi Sachin thank you for your help.
I found the Watches page and will stop them one by one since I'm still afraid there are no bulk way to do them at once.
Also the autowatch info helped me while I need that feature in usual case but not applied on this case since I've made bunch of pages by add-on.
np thanks a lot!
If you have many watches because you imported a lot of pages it is messy to stop all the watches step by step.
I wrote a simple bookmarklet so I can stop all watches on the page with just one click and the page will reload as well.
For example, if you have 30 watch pages, you only need 30 clicks to stop them all.
This is the js-code of the bookmarklet:
javascript: void (function () { document.getElementsByClassName('link-stop-watching').forEach(b => b.click()); location.reload();})();
You are my hero! I had 60+ pages of these to deal with. Much gratitude from a Confluence administrator...
Hi can you descrire how use this?? Thank you
Ask Google what a bookmarklet is and how to use it. The bookmarklet code is above.
I wrote this up a while ago (February 3, 2022), borrowing from a deleted user, and I still use it. I know a couple other people told me it worked for them too.It will help with: * Watched pages * Watched spaces * Save for Later * Draftshttps://community.atlassian.com/t5/Confluence-discussions/Bulk-removing-your-Watched-pages-spaces-Save-for-Later-and/td-p/1933623
Here is a boosted version of the script that allows you to target only a particular space.In my case, my role changed at my company such that I handed off ownership of a space I'd maintained for a long time and authored hundreds of pages in.I wanted to stop watching every single one of that space's pages, but keep my other watches.The way this script works:The code below builds a function called "go" that takes two parameters:
So, leaving the "live" parameter out or setting it "false" lets you check what would be done without doing it.
function go(searchText, live) { var ixs = []; var logmsg = "would stop: "; if (live) { logmsg = "stopping: "; } var spans = $("#page-watches tr td span.smalltext"); spans.each((k, v) => { if (v.textContent.includes(searchText)) { ixs.push(k) } } ); console.log(ixs.join(", ")); var as = $("#page-watches tr td.tableview-action-icon div a:not('.hidden')"); console.log(as.length); as.each((k, v) => { if (ixs[0] == k) { ixs.shift(); if (v.classList.contains("link-stop-watching")) { console.log(logmsg + k); if (live) { v.click(); } } } } ); if (live) { setTimeout(() => location.reload(), 2000); }}
So, for example, if you want to bulk unwatch all pages for spaces with "Foo" in their name, you would first paste the above function into your browser console, and then run:
go("Foo"); // shows you which links it would click using their index positiongo("Foo", true); // clicks those particular stop watching links, ignores others
Note: you will need to re-paste the function after the page reloads. You may also run into a point where all 20 links on the Watches page you are on are not hits. In that case, you will need to manually navigate to the next page, paste, and run again.
Inspired by your post I have rewritten my bookmarklet code, thus only watches of a specific space are removed. The user is asked for the space name, which is temporarily stored until the last page is processed by executing this bookmarklet.
javascript: void (function () { var tbl = document.getElementById('page-watches');
var tblRows = tbl.tBodies[0].rows; var rowsCount = tblRows.length; var itemName = 'watchSpacePattern'; if(rowsCount > 0) { var spacePattern = localStorage.getItem(itemName); if (spacePattern == undefined) { spacePattern = '(' + prompt('Enter the space name for which you want to delete the watches.') + ')'; localStorage.setItem(itemName, spacePattern); } tblRows.forEach(rw => { var spaceName = rw.cells[0].children[2].textContent; if (spaceName == spacePattern) { rw.cells[1].children[0].children.forEach(ch => { if(ch.textContent == 'Stop Watching'){ ch.click(); } }) } }); if(rowsCount < 20) { localStorage.removeItem(itemName); } setTimeout(() => location.reload(), 1000); } else { localStorage.removeItem(itemName); }})();
Happy coding ;-)
Now that we have moved from the company server to the Atlassian cloud, the bookmarklet code no longer works in the cloud. Since an HTMLCollection is returned instead of an array when collecting the watches, iteration using forEach is no longer possible.Thus I reworked the bookmarklet code:
javascript: void (function () {let links=document.getElementsByClassName('link-stop-watching'); for(i=0;i<links.length;i++){links[i].click();} setTimeout(() => location.reload(), 1000);})();
It should also work with the server version, but I can't test it anymore.Good luck
It looks like you're new here. Sign in or register to get started.