Skip to content

Commit

Permalink
feat: add archive and unarchive functionality for issues, Issue Archi…
Browse files Browse the repository at this point in the history
…ving #1942
  • Loading branch information
andrewbolster committed Feb 12, 2025
1 parent 3a630c5 commit 72a3045
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3600,6 +3600,37 @@ def search_issues(

return issues

# Archive Issues
def archive_issues(self, issues: ResultList[Issue]) -> dict[str, Any]:
"""Archive a list of Issues.
Args:
issues (ResultsList[Issue]): List of issues to archive
Returns:
Dict[str, Any]: Response from the server indicating success or failure for each issue in the list
"""
url = self._get_url('issue/archive')
issue_keys_to_archive = [issue.key for issue in issues]
payload = {"issueIdsOrKeys": issue_keys_to_archive}
response = self._session.put(url, data=json.dumps(payload))
return response.json()

def unarchive_issues(self, issues: ResultList[Issue]) -> dict[str, Any]:
"""Unarchive a list of Issues.
Args:
issues (ResultsList[Issue]): List of issues to unarchive
Returns:
Dict[str, Any]: Response from the server indicating success or failure for each issue in the list
"""
url = self._get_url('issue/unarchive')
issue_keys_to_archive = [issue.key for issue in issues]
payload = {"issueIdsOrKeys": issue_keys_to_archive}
response = self._session.put(url, data=json.dumps(payload))
return response.json()

# Security levels
def security_level(self, id: str) -> SecurityLevel:
"""Get a security level Resource.
Expand Down

0 comments on commit 72a3045

Please sign in to comment.