{"record":{"id":"4b750063c3424b5f","repo":"zed-industries/zed","slug":"field-field-name-not-found-on-board","errorCode":null,"errorMessage":"Field '{field_name}' not found on board","messagePattern":"Field '(.+?)' not found on board","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"script/github-guild-board.py","lineNumber":299,"sourceCode":"            }\n          }\n        }\n        \"\"\",\n        {\"contentId\": content_node_id},\n    )\n    node = data.get(\"node\") or {}\n    for item in (node.get(\"projectItems\") or {}).get(\"nodes\", []):\n        if item[\"project\"][\"id\"] == project_id:\n            return item\n    return None\n\n\ndef set_project_field(project, item_id, field_name, option_name):\n    field = next(\n        (f for f in project[\"fields\"][\"nodes\"] if f.get(\"name\") == field_name), None\n    )\n    if not field:\n        raise RuntimeError(f\"Field '{field_name}' not found on board\")\n    option_id = next(\n        (o[\"id\"] for o in field.get(\"options\", []) if o[\"name\"] == option_name), None\n    )\n    if not option_id:\n        raise RuntimeError(f\"Option '{option_name}' not found in field '{field_name}'\")\n    github_graphql(\n        \"\"\"\n        mutation($projectId: ID!, $itemId: ID!, $fieldId: ID!, $optionId: String!) {\n          updateProjectV2ItemFieldValue(input: {\n            projectId: $projectId, itemId: $itemId, fieldId: $fieldId,\n            value: { singleSelectOptionId: $optionId }\n          }) { projectV2Item { id } }\n        }\n        \"\"\",\n        {\n            \"projectId\": project[\"id\"],\n            \"itemId\": item_id,\n            \"fieldId\": field[\"id\"],","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/script/github-guild-board.py#L281-L317","documentation":"set_project_field on the guild board resolves field_name against project[\"fields\"][\"nodes\"] before running updateProjectV2ItemFieldValue; a miss raises with a terse message (no available-names list in this variant). The lookup is exact string equality, so renames, case differences, or the wrong project make it fail before any mutation is sent.","triggerScenarios":"Guild board automation runs with a field name (e.g. \"Status\") that no longer exists on the project — renamed on the board, project recreated from a template, or a stale PROJECT_NUMBER pointing at a different board.","commonSituations":"Board maintainers rename status fields during process changes; the script's field constants lag the live board; case drift between the constant and the board.","solutions":["List the project's actual field names (they are already in project['fields']['nodes']) and align the script constant exactly","Rename the board field back if the script's name is the source of truth","Confirm PROJECT_NUMBER targets the guild board","Include the available names in the error to make the mismatch self-diagnosing"],"exampleFix":"// before\nfield = next((f for f in project[\"fields\"][\"nodes\"] if f.get(\"name\") == field_name), None)\nif not field:\n    raise RuntimeError(f\"Field '{field_name}' not found on board\")\n\n// after\nfield = next((f for f in project[\"fields\"][\"nodes\"] if f.get(\"name\") == field_name), None)\nif not field:\n    available = [f[\"name\"] for f in project[\"fields\"][\"nodes\"] if f.get(\"name\")]\n    raise RuntimeError(f\"Field '{field_name}' not found on board; available: {available}\")","handlingStrategy":"validation","validationCode":"def board_has_field(project: dict, field_name: str) -> bool:\n    return any(f.get(\"name\") == field_name for f in project[\"fields\"][\"nodes\"])","typeGuard":"def find_field(project: dict, field_name: str) -> dict | None:\n    return next((f for f in project[\"fields\"][\"nodes\"] if f.get(\"name\") == field_name), None)","tryCatchPattern":"try:\n    set_project_field(project, item_id, STATUS_FIELD, option)\nexcept RuntimeError as exc:\n    if \"not found on board\" in str(exc):\n        log(f\"Board field drift: {exc}\")\n    else:\n        raise","preventionTips":["Snapshot the board's field names at startup and compare against required ones","Include available names in error messages","Coordinate board renames with script releases","Use exact case in constants and never lowercase field names"],"tags":["github-projects","graphql","config-drift","python"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}