Delete issue via Database with all dependencies

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
r0mbus
Posts: 4
Joined: 12 Nov 2015, 13:04

Delete issue via Database with all dependencies

Post by r0mbus »

Hello,

i need to delete many issues (but not all). Its very complicated to type each issue-number manually to delete it.
How can i delete those issues via Database? Suddenly its not enough to remove it from mantis_bug_table only. I want to remove all comments, relationships, bugnotes etc aswell.

Do you have any ideas?

Thanks :)
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Delete issue via Database with all dependencies

Post by atrol »

Use the "View Issues" page for it.
There is a menu at the bottom of the page with options to change/delete all selected issues in one go.
Please use Search before posting and read the Manual
r0mbus
Posts: 4
Joined: 12 Nov 2015, 13:04

Re: Delete issue via Database with all dependencies

Post by r0mbus »

atrol wrote:Use the "View Issues" page for it.
There is a menu at the bottom of the page with options to change/delete all selected issues in one go.
Thats right, but i dont want to click 200-300 times to mark all issues. Ive got a list with issue-numbers and i want to delete all issues from the list with 1 step. I need to do it every week, thats why it is important for me to optimize the process.
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Delete issue via Database with all dependencies

Post by atrol »

You don't have to click 200-300 times.
There is a check box "Select All" at the bottom.
Please use Search before posting and read the Manual
rombert
Posts: 66
Joined: 05 Nov 2009, 08:43

Re: Delete issue via Database with all dependencies

Post by rombert »

You can also use the SOAP API to bulk delete issues, see

https://www.mantisbt.org/manual/admin.config.soap.html
r0mbus
Posts: 4
Joined: 12 Nov 2015, 13:04

Re: Delete issue via Database with all dependencies

Post by r0mbus »

I solved it via JS and Browser-Developer-Console:
javascript:[].forEach.call(document.querySelectorAll('input[value="ISSUE_NUMBER"]'),function(el){el.checked=true});
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Delete issue via Database with all dependencies

Post by atrol »

There is no need for any JavaScript solution.
Seems you didn't read what I wrote before.
atrol wrote: There is a check box "Select All" at the bottom.
Please use Search before posting and read the Manual
r0mbus
Posts: 4
Joined: 12 Nov 2015, 13:04

Re: Delete issue via Database with all dependencies

Post by r0mbus »

atrol wrote:There is no need for any JavaScript solution.
Seems you didn't read what I wrote before.
atrol wrote: There is a check box "Select All" at the bottom.
It seems, that my english is not good enough to explain my problem :)

For example - ive got 1000 issues in my Mantis-DB. I want to delete 300 of them, but not the first 300 and not the last 300. Just some random 300 issues. Ive got a list with IDs, so what im doing:
-let mantis show me all 1000 issues on one page
-generating long JS-List with all Issue-IDs from the list
-copy & paste it to Developer console, then execute
-all 300 issues are now checked and ready to be deleted.

Is there any another way to make it easier?
Post Reply