Bulk Unarchieve/ Restore Issues

Harshit Grover
Contributor
September 16, 2022

Hi , 

 

I have a Project by the name of MBFF and it had 789 defects in it. I have archived all the 789 defects. 

Is there a way to bulk restore/unarchive them and also can I migrate the issue type of these issues from Defect to Bug ?

 

If I download a CSV (All fields) export of archived issues (Defects) , then bulk upload it..

Will it be uploaded as a new issues ? 

Can it be uploaded as Bug? 

 

 

 

3 answers

5 votes
Igor Dugalic
Contributor
May 3, 2023

Hi @Harshit Grover 

I faced a similar situation and wrote a script for this that can be executed in the console. I know that this post is a few months old, but maybe it can help others.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.archiving.ArchivedIssueService

def um = ComponentAccessor.userManager
def archivedIssueService = ComponentAccessor.getComponent(ArchivedIssueService)

def techUser = um.getUserByName("user") // replace user with a user ID that has the required permissions
def issues = ["key-1", "key-2"] // replace with all issue keys that need to be restored/unarchived

for (item in issues) {

def validationArchive = archivedIssueService.validateRestoreIssue(techUser, item, false)

if (validationArchive.valid) {
archivedIssueService.restoreIssue(validationArchive)
}
}
0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 16, 2022

Hello @Harshit Grover 

This post indicates there is not a Bulk Restore option, but that you can use the JIRA REST API to restore multiple issues at once.

https://community.atlassian.com/t5/Jira-Software-questions/How-can-I-bulk-un-archive-Jira-issues/qaq-p/1756508

(credit to @Mohamed Benziane )

I believe the migration to a different issue type will need to be a separate step.

I don't believe you can use the CSV import process to restore the issues nor to change the Issue Type for an issue.

0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 16, 2022

Suggest an answer

Log in or Sign up to answer