Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I archive an issue using the jira-python library?

Jeff Shepherd
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2025

I am using the jira 3.10.1.dev4 jira-python library interacting with my Jira Server 9.12 cluster. I have a set of issues created from a jira.search_issues() call. I would like to archive them.  I don't see a specific jira.archive() call that would seem to be most appropriate. The Jira REST call would be PUT /rest/api/2/issue/{issueIdOrKey}/archive (single) or POST /rest/api/2/issue/archive (multiple).

How do I archive the issues using the jira-python library?

 

3 answers

1 accepted

0 votes
Answer accepted
Jeff Shepherd
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 15, 2025

I had to write my own wrapper around the `jira-python` library

from jira import JIRA

class MyJIRA(JIRA):
'''Inheriting from jira-python library'''
def archive_issue(self, issue: int | str) -> bool:
url = self._get_latest_url(f"issue/{issue}/archive")
self._session.put( url )
return True

myJira = MyJIRA(basic_auth=(jira_username, jira_password), server=jira_server)
myJira.archive_issue('ABC-1234')
0 votes
Piyush Annadate _ACE Pune_
Community Champion
May 9, 2025

Hello @Jeff Shepherd ,
Checkout https://support.atlassian.com/jira/kb/is-there-an-easy-way-to-archive-a-lot-of-issues/ - this had update ~months in past.

Else, API  via post method can be done, PUT /rest/api/2/issue/{issueIdOrKey}/archive but that would be per issue basis.

Jeff Shepherd
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 13, 2025

Thank you for your response. I have used that Jira KB article in the past. For some reason it stopped working for me and I was hoping to transition my code to the jira-archive library, which has been easier for me to understand.

Is there a way to use jira-archive to access the post method? Somehow sending the /rest/api/2/issue/{issueIdOrKey}/archive to, say jira.resources.update() or jira.resources.Resource()?

0 votes
Lucas Modzelewski _Lumo_
Atlassian Partner
May 9, 2025

You can check what Chat GPT suggests or search through more technical developer community: https://community.developer.atlassian.com/ 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.12.18
TAGS
AUG Leaders

Atlassian Community Events