Hi ,
How to delete projects in jira automatically based on conditions like projects belonging to category A or project created before 2 years. The script or trigger should automatically check for condition and delete the projects without any manual intervention.
How to achieve this?
Thanks,
Krithica
Technically, you can't do this. Jira does not record when a project is created, so you have no date to work with.
That just means you need a different rule. I'd base a rule on looking for the earliest created issue (which is an approximation for "project created") and maybe also check "last updated" or "last created" issue for a sanity check on if the project is still actively used.
Then, yes, use one of the automation apps to code a script to do this. You'll need Scriptrunner or Powerscripts (I'm not sure this can do it, but I don't want to look like I'm selling SR as the only option)
Be warned though, you must think about backups before trying anything like this. Deleted projects are gone, completely, and there's no way to get them back other than from a backup, so one error, and you could destroy something you need.
I'd also look at housekeeping - deleting a project destroys the header and all the issues in it, but leaves all the config behind. You might want to look at something that kills off unused schemes (and fields) after a project deletion as well.
I want to delete the projects that are archived before 2 yrs. The script/listerener should delete those projects ? is this possible?
Thanks,
Krithica
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can do that using CRON jobs and Jira's rest API.
This fetch all project in JSON format
curl --request GET \ --url '/rest/api/3/project' \ --header 'Authorization: Bearer ' \ --header 'Accept: application/json'
This deletes project,
curl --request DELETE \ --url '/rest/api/3/project/{projectIdOrKey}' \ --header 'Authorization: Bearer '
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does this REST API call delete project and its configurations (workflows, if not shared), screen(if no shared) etc. or it is just a doing what we do in the front-end - Deleting project's data and Nothing else.
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.