Skip to content

Issue Archiving #1942

Open
Open
@andrewbolster

Description

@andrewbolster

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions