Dozens of issues have been entered into my project on github that have no place there. Some Einstein ran a script and created all these nonsensical issues through the api.
There is no way to actually delete the issues. What you can do, to indicate that this was a spam attack, is create a new label. You can then use the API to edit each issue to be closed and labeled with the SPAM
label. Those who look at it will see the label displayed along side the issue and it's really the best you can hope for.
If you're more comfortable with a specific language, check for a library written in it to make your life easier too.
Since Nov. 2018 and this tweet... you now can delete issues (if you are an Administrator/owner of a GitHub project)
The tweet read:
You've been asking for it.
You know the issue(s).
Delete 'em.
Due to legal problems I've had to delete several issues with many comments of a project. I did as follows:
Copy paste on browser address bar:
javascript:(function(){ $('.delete-button.octicon.octicon-x.js-comment-delete').each(function(){ href=$(this).attr("href"); if(href!==undefined) { console.log("DELETING: "+href); $.ajax({type:"DELETE",url:href}); } }); firstCommentToedit=$('form.js-comment-update')[0]; $.ajax({ type:"POST", url:firstCommentToedit.action, data:{ _method:$(firstCommentToedit).find('input[name=_method]').val(), "issue[body]":"THIS ISSUE WAS DELETED AND BLOCKED", authenticity_token:$(firstCommentToedit).find('input[name=authenticity_token]').val() } }); lockLink=$('a[href$="/lock"]')[0]; if (lockLink!==undefined) { $.ajax({ type:"POST", url:lockLink.href, data:{_method:$(lockLink).attr("data-method")} }); } setTimeout(function(){window.location=window.location;},3000) })()
Expanded:
javascript: (function() {
$('.delete-button.octicon.octicon-x.js-comment-delete').each(function() {
href = $(this).attr("href");
if (href !== undefined) {
console.log("DELETING: " + href);
$.ajax({
type: "DELETE",
url: href
});
}
});
firstCommentToedit = $('form.js-comment-update')[0];
$.ajax({
type: "POST",
url: firstCommentToedit.action,
data: {
_method: $(firstCommentToedit).find('input[name=_method]').val(),
"issue[body]": "THIS ISSUE WAS DELETED AND BLOCKED",
authenticity_token: $(firstCommentToedit).find('input[name=authenticity_token]').val()
}
});
lockLink = $('a[href$="/lock"]')[0];
if (lockLink !== undefined) {
$.ajax({
type: "POST",
url: lockLink.href,
data: {
_method: $(lockLink).attr("data-method")
}
});
}
setTimeout(function() {
window.location = window.location;
}, 3000)
})()