Answer stability round 1: 0 🔴, 1 🟡 (0 misread); split the re-rank into the pure rank_moves, rank only just before, as the item says, and name ranking in the README and the protocol
This commit is contained in:
@@ -156,7 +156,7 @@ class JiraPlan:
|
||||
notes.append(f"filed {key}, but cannot link it as blocked by {blocker}: {linked.reason}; link it in Jira")
|
||||
if isinstance(before, Failure):
|
||||
notes.append(f"filed {key}, but cannot rank it: {before.reason}; rank it in Jira")
|
||||
elif before is not None and (refused := rank_refusal(self.epic.site, key, before, False, authorization, self.http)):
|
||||
elif before is not None and (refused := rank_refusal(self.epic.site, key, before, authorization, self.http)):
|
||||
notes.append(f"filed {key}, but cannot rank it before {before}: {refused}; rank it in Jira")
|
||||
return tuple(notes)
|
||||
|
||||
@@ -442,9 +442,9 @@ def children(epic: Epic, authorization: str, http: Http) -> list[object] | Failu
|
||||
return searched(epic.site, f"{epic.key}'s children", f'parent = "{epic.key}" AND statusCategory != Done ORDER BY Rank ASC', {"fields": ["summary", "description", "fixVersions", "issuelinks"], "properties": [PROPERTY]}, authorization, http)
|
||||
|
||||
|
||||
def rank_refusal(site: str, key: str, other: str, after: bool, authorization: str, http: Http) -> str | None:
|
||||
"""Ranks the issue named key just before the issue named other, or just after it where after is True; why Jira refused, or None where it didn't. Jira answers a rank it made with no body, and one it refused with an error, or with an entry per issue that holds the errors."""
|
||||
answer = http("PUT", f"{site}/rest/agile/1.0/issue/rank", authorization, {"issues": [key], "rankAfterIssue" if after else "rankBeforeIssue": other})
|
||||
def rank_refusal(site: str, key: str, before: str, authorization: str, http: Http) -> str | None:
|
||||
"""Ranks the issue named key just before the issue named before; why Jira refused, or None where it didn't. Jira answers a rank it made with no body, and one it refused with an error, or with an entry per issue that holds the errors."""
|
||||
answer = http("PUT", f"{site}/rest/agile/1.0/issue/rank", authorization, {"issues": [key], "rankBeforeIssue": before})
|
||||
if isinstance(answer, Failure):
|
||||
return answer.reason
|
||||
entries = answer.get("entries") if isinstance(answer, dict) else None
|
||||
|
||||
Reference in New Issue
Block a user