Forums

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

Archive more than 1k issues using the Python script

Goon Yin Chew March 9, 2022

I am trying to use the Python script suggested in this post: https://confluence.atlassian.com/jirakb/is-there-an-easy-way-to-archive-a-lot-of-issues-976766896.html

However, I received the following error:
Traceback (most recent call last):
File "jira_archive.py", line 73, in <module>
MassArchive(url, name, password).archive_issues(jql_query, notifyUser, int(limit))
File "jira_archive.py", line 47, in archive_issues
issue_keys = list(self.search_issues(jql, limit))
File "jira_archive.py", line 16, in search_issues
max_per_request = self.get_limit_per_request(session)
File "jira_archive.py", line 43, in get_limit_per_request
return int(list(filter(lambda row: row['id'] == "jira.search.views.default.max", json.loads(resp.text)))[0]['value'])
File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded


I suspect the error is due to the url_archive (https://gojiratest.mycompany.com/rest/api/2/issue/archive) is not found. Please advise if you had used this Python script and have any suggestions to resolve the No JSON object could be decoded error.

Thank you in advance for your time! 

1 answer

0 votes
Piyush Annadate _ACE Pune_
Community Champion
May 9, 2025

Try with API - PUT /rest/api/2/issue/{issueIdOrKey}/archive

Suggest an answer

Log in or Sign up to answer