Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Archiving #1942

Open
andrewbolster opened this issue Feb 12, 2025 · 0 comments
Open

Issue Archiving #1942

andrewbolster opened this issue Feb 12, 2025 · 0 comments

Comments

@andrewbolster
Copy link

Problem trying to solve

Trying to bulk archive issues; the UI doesn't make this easy so I'd hope the jira library just did it, but it doesn't, so I'm gonna try and fix it...

Possible solution(s)

jql = "status = 'done' and type = 'task' order by created desc"
while response:=jira.search_issues(jql):
    archive_keys = set()
    for issue in tqdm(response):
        print(issue.key, issue.fields.summary)
        archive_keys.add(issue.key)
    jira.archive_issues(list(archive_keys)})

Alternatives

This can be accomplished with the existing API like this

jql = "status = 'done' and type = 'task' order by created desc"
while response:=jira.search_issues(jql):
    archive_keys = set()
    for issue in tqdm(response):
        print(issue.key, issue.fields.summary)
        archive_keys.add(issue.key)
    jira._session.put(jira._get_url(f"/issue/archive"), data={"issueIdsOrKeys": list(archive_keys)})

Additional Context

Now, archive issues on Jira Cloud with APIs - August'23

API Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant