Deleting all issues in a repository

Hello,

my problem is similar to this one: Wiping issues completely

basically what happened, I screwed something up with the API and now have 90,000+ issues in my private repository. Is there a way to quickly delete all issues in my repository? I know I can close some of them at once but I would rather have all of them gone completely (also going through them page by page will take me forever).

I would also be fine if a GitLab admin would just delete all of them for me.

Hi and welcome to the forum! :slight_smile:

I don’t think you can bulk-delete issues. If you need to do this, I’d suggest using the API:

you could check my temp solution here Bulk delete issues (#24403) · Issues · GitLab.org / GitLab · GitLab

I used this Script (written by ChatGPT :D):

#!/bin/bash

# Define the access token and project ID
ACCESS_TOKEN="glpat-bxbDYKHiTaiF3EjG-yak"
PROJECT_ID=10
GITLAB_URL="https://xxx.gitlab.de.de/api/v4"

# Fetch all issues from the project
issues=$(curl --header "PRIVATE-TOKEN: $ACCESS_TOKEN" --url "$GITLAB_URL/projects/$PROJECT_ID/issues")

# Parse issue IDs from the JSON response
issue_ids=$(echo $issues | jq -r '.[].iid')

# Loop through each issue ID and delete the issue
for issue_id in $issue_ids; do
  echo "Deleting issue ID: $issue_id"
  curl --request DELETE \
    --header "PRIVATE-TOKEN: $ACCESS_TOKEN" \
    --url "$GITLAB_URL/projects/$PROJECT_ID/issues/$issue_id"
done