Jira Projects move to Trash after deleting, how to delete them permanently

Soumik Mukherjee November 26, 2023

Hi community, recently I came across an issue on Jira. I am actually writing automation codes which create Jira Projects, issues, custom fields and associate them correctly through a project setup configuration file that I have created.

After all the configuration is done, I run multiple tests on them and finally I want to delete all of them.

I went through the API documentation and found REST APIs that delete all of them, but the projects move to Trash. So, the next time when I run the tests, it looks for the projects through a GET call and gets a success message since the API calls consider the projects in the Trash as existing only. But then when I try to associate the issues, custom fields, etc to the project, I receive an error.

So, how can I delete the Projects from Jira and then from the Trash through REST API?

2 answers

1 accepted

1 vote
Answer accepted
Soumik Mukherjee November 28, 2023

Hi community, I have myself found the REST API for the same. As a matter of fact, it is not actually a DELETE API, which ideally it should have been, rather it is a POST API.

The API is:

/rest/api/3/project/{projectIdOrKey}/delete

We can read more about it here

matthew baltrusitis
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 17, 2024

If you'd like to utilize a proper DELETE API, you can pass the `enableUndo` query param.

 

```

/rest/api/3/project/{projectIdOrKey}?enableUndo=false

```

Like # people like this
Soumik Mukherjee February 23, 2024

Thanks @matthew baltrusitis this is definitely an alternative to the way I suggested. Appreciate the response.

0 votes
Berat Altunhan November 27, 2023

Hi, ,

If you are Jira admin, you can follow these step:

1. Click 'Setting' button from the right corner.

2. Click 'Project' and than click 'Trash' button.

3. Click three dots and select delete permanently.

Soumik Mukherjee November 28, 2023

Hi @Berat Altunhan thanks for the answer, but I wanted to know the REST API for the same as I have already mentioned in the question at the end.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events