How to bulk delete request types in Jira Service Management


Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Knowledge Prerequisites

Bulk-removing request types require a baseline technical skill set, including but not limited to:

  • Comfort with API
  • Comfort with running Database Queries
  • Comfort with scripting in your preferred code 

Summary

If a large number of Request types have been created unintentionally and you would like to remove them in bulk, there is no way to do so from the UI.

We don't recommend deleting directly from the database as there could be linked data.

Environment

Jira Service Management Data Center

Tested in 4.20.8

Solution

We can use the following SQL query to gather the data we would like to remove:

SELECT "ISSUE_TYPE_ID","ID","NAME","INTRO" FROM "AO_54307E_VIEWPORTFORM"

Please note you may have duplicate names, which would indicate that you have multiple projects with the same request type name.

Which should result in something like this:

The ISSUE_TYPE_ID is associated with the Request Type Group in the above example test 1-7 are all associated with the Common Request Group

We can then use the following API URI with the DELETE Method to remove request types:

<BaseURL>/rest/servicedesk/1/servicedesk/<ISSUE_TYPE_ID>/request-type-groups/1/request-types/<ID>

With the above information you can use your prefered code and remove request type.

I was able to remove a single request type with the following CURL command:

curl -u <Admin account>:<password> -X DELETE -H "Content-Type: application/json" <BaseURL>/rest/servicedesk/1/servicedesk/<ISSUE_TYPE_ID>/request-type-groups/1/request-types/<ID>

We recommend testing on a single request type and once working, test on a smaller batch and scale up.




Last modified on Nov 5, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.