In JIRA shell I'm doing the following:
In [3]: while True:
...: res = jira.search_issues(jql_str='project = FAD', maxResults=100)
...: if len(res) == 0:
...: break
...: for issue in res:
...: try:
...: print('deleting %s' % issue.key)
...: issue.delete(deleteSubtasks=True)
...: except Exception as e:
...: print(e)
the input works until i come to an issue with a sub task. Then I get this errort:
JiraError HTTP 500 url: http://nyc-cbmweb-d29:8080/rest/api/2/issue/175200?deleteSubtasks=True
text: Internal server error
response headers = {'X-Frame-Options': 'SAMEORIGIN', 'X-XSS-Protection': '1; mode=block', 'X-AUSERNAME': 'flowbot', 'X-ASEN': 'SEN-9828933', 'X-ASESSIONID': '1u79oy6', 'Content-Security-Policy': "frame-ancestors 'self'", 'X-Content-Type-Options': 'nosniff', 'Date': 'Wed, 07 Mar 2018 14:52:32 GMT', 'Transfer-Encoding': 'chunked', 'Cache-Control': 'no-cache, no-store, no-transform', 'Content-Type': 'application/json;charset=UTF-8', 'X-AREQUESTID': '592x122483x1', 'Connection': 'close', 'X-Seraph-LoginReason': 'OK'}
response text = {"errorMessages":["Internal server error"],"errors":{}}
According to the rest API documentation, deleteSubtasks=True should work
UPDATE: I actually tried this from the browser and it failed due to a
java.lang.NullPointerException
Since you are seeing this error in both REST calls and in the browser, it tends to indicate that there is a problem with this Jira instance, specifically in regards to either the database or the indexes Jira created in regards to that database data.
I would recommend trying to walk through the steps in Cannot delete issue in JIRA - NullPointerException at DefaultIssueDeleteHelper.removeSubTasks
It's possible the issues have been deleted, but the indexes might be corrupted in such a way that they still believe the issues exist. If you rebuild the indexes in Jira (lock and rebuild) it would correct this problem if my hunch is correct.
Please note that a lock and rebuild method of reindexing will leave Jira inaccessible to all users until that index job is complete. If you have a large instance, this could take a long time to complete.
Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!
Help us plant more trees
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.