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?
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')
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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()?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can check what Chat GPT suggests or search through more technical developer community: https://community.developer.atlassian.com/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.