Re-rank Jira's backlog to match an epic's ranking, moving only the issues the loop filed
This commit is contained in:
@@ -5,7 +5,7 @@ import typing
|
||||
|
||||
from adf_codec.convert import adfs_to_markdown, markdown_to_adf, Refused
|
||||
from atlassian.client import basic_auth, Http, jira_json, ToAdf, ToMarkdown
|
||||
from plan_store.jira_epic import blocked_by_links, FILED_BY, ISSUE_KEY, ISSUE_TYPE, project_of, PROPERTY, scores, searched
|
||||
from plan_store.jira_epic import blocked_by_links, FILED_BY, ISSUE_KEY, ISSUE_TYPE, project_of, PROPERTY, rank_refusal, scores, searched
|
||||
from project_config.settings import Epic
|
||||
from do_epic.backend.protocol import EpicIssue, no_child, no_parent, unfit, unfit_label
|
||||
from failure import Failure
|
||||
@@ -92,6 +92,13 @@ class JiraEpic:
|
||||
edited = self.http("PUT", f"{self.epic.site}/rest/api/3/issue/{key}", authorization, {"update": {"labels": [{"add": label}]}})
|
||||
return Failure(f"cannot label {key}: {edited.reason}") if isinstance(edited, Failure) else None
|
||||
|
||||
def rank(self, key: str, other: str, after: bool = False) -> None | Failure:
|
||||
authorization = basic_auth(self.env_file)
|
||||
if isinstance(authorization, Failure):
|
||||
return authorization
|
||||
refused = rank_refusal(self.epic.site, key, other, after, authorization, self.http)
|
||||
return Failure(refused) if refused else None
|
||||
|
||||
def not_a_parent(self, parent: str, authorization: str) -> Failure | None:
|
||||
"""Why nothing can be filed under parent; None where it is the epic or one of its child issues."""
|
||||
if parent == self.epic_key:
|
||||
|
||||
Reference in New Issue
Block a user