Answer product-owner round 1: 0 🔴, 3 🟡 (0 misread); name the issue to block by in the worker's prompt, and link the issue as Jira creates it

This commit is contained in:
Lilleman
2026-11-19 16:06:42 +01:00
parent b2630b8148
commit 5d9d880f44
8 changed files with 33 additions and 36 deletions
+5 -6
View File
@@ -74,17 +74,16 @@ class JiraEpic:
if isinstance(description, Failure):
return Failure(f"cannot convert the detail to a Jira description: {description.reason}")
fields["description"] = description
created = self.http("POST", f"{self.epic.site}/rest/api/3/issue", authorization, {"fields": fields | {"issuetype": kind}, "properties": properties})
body: dict[str, typing.Any] = {"fields": fields | {"issuetype": kind}, "properties": properties}
if blocked_by:
# Linked as it is created, so no issue is left filed and unblocked. The inward issue blocks the new one.
body["update"] = {"issuelinks": [{"add": {"type": {"name": BLOCKS}, "inwardIssue": {"key": blocked_by}}}]}
created = self.http("POST", f"{self.epic.site}/rest/api/3/issue", authorization, body)
if isinstance(created, Failure):
return Failure(f"cannot file the issue under {parent}: {created.reason}; {PERHAPS_FILED.format(under=parent)}")
key = created.get("key") if isinstance(created, dict) else None
if not isinstance(key, str) or not ISSUE_KEY.fullmatch(key):
return Failure(f"Jira answered the new issue without an issue key; {PERHAPS_FILED.format(under=parent)}")
if blocked_by:
# Jira names the two ends by the link type's sides: the inward issue blocks the outward one, which then reads "is blocked by" it.
linked = self.http("POST", f"{self.epic.site}/rest/api/3/issueLink", authorization, {"type": {"name": BLOCKS}, "inwardIssue": {"key": blocked_by}, "outwardIssue": {"key": key}})
if isinstance(linked, Failure):
return Failure(f"filed {key} under {parent}, but cannot link it as blocked by {blocked_by}: {linked.reason}; link it in Jira")
return key
def add_label(self, key: str, label: str) -> None | Failure: