Recently I had to delete a user from pagerduty, but the interface blocked me from doing so, saying that I couldn't complete the deletion until all of that users issues were resolved.
I looked at the unresolved issues and there were thousands.
These issues were beyond their expiration dates, and could be marked resolved,
but the process of doing so was time consuming.
Each round of deletion took at around 10 seconds because of latency and each involved 3 separate clicks.
Further, each round of deletion only eliminated at most 100 incidents.
But the glory of coding is that repetitive boring tasks become opportunites to try something fun to automate them.
Anyway, here's the script that I put together to mark these expired issues as resolved while I worked on other things:
setInterval(() => {
document.getElementsByClassName("ember-checkbox")[0].click();
document.getElementsByClassName("resolve-incidents")[0].click();
document.getElementsByClassName("btn-primary")[0].click();
}, 10000)
It just performs the three required clicks and then waits while the next set of resolved issues is loaded before it starts again.