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?
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.
If you'd like to utilize a proper DELETE API, you can pass the `enableUndo` query param.
```
/rest/api/3/project/{projectIdOrKey}?enableUndo=false
```
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @matthew baltrusitis this is definitely an alternative to the way I suggested. Appreciate the response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I deleted a project which then went to trash for 60 days. Now I am trying to create the same project under my other username, but it says the project already exists.
I tried following your advice in order to delee the project from trash, but when I go on Settings, there is no label "Projects", only "Atlassian account settings", "Personal Jira settings", "User Management", and "Billing"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just for anyone confused with a similar scenario:
It is important to know that Jira does not have a traditional "recycle bin" or "trash" feature that allows you to easily recover deleted boards or projects.
Once an issue is deleted in Jira, it is permanently removed from the Jira database.
The user can only recover such deleted instances from either locally backed up Jira Cloud or Jira Server files or other complex means.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.