{"record":{"id":"0c137025aac1ee62","repo":"github/github-mcp-server","slug":"updated-field-name-must-be-a-non-empty-string-0c1370","errorCode":null,"errorMessage":"updated_field.name must be a non-empty string","messagePattern":"updated_field\\.name must be a non-empty string","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/projects_batch.go","lineNumber":530,"sourceCode":"\tspec.value = value\n\n\tidField, hasID := input[\"id\"]\n\tnameField, hasName := input[\"name\"]\n\tswitch {\n\tcase hasID && hasName:\n\t\treturn spec, fmt.Errorf(\"updated_field must set either id or name, not both\")\n\tcase !hasID && !hasName:\n\t\treturn spec, fmt.Errorf(\"updated_field requires either id or name\")\n\tcase hasID:\n\t\tid, err := validatePositiveInt64(idField)\n\t\tif err != nil {\n\t\t\treturn spec, fmt.Errorf(\"updated_field.id: %w\", err)\n\t\t}\n\t\tspec.id = id\n\tdefault:\n\t\tname, ok := nameField.(string)\n\t\tif !ok || name == \"\" {\n\t\t\treturn spec, fmt.Errorf(\"updated_field.name must be a non-empty string\")\n\t\t}\n\t\tspec.name = name\n\t}\n\treturn spec, nil\n}\n\nfunc resolveBatchProjectField(ctx context.Context, gqlClient *githubv4.Client, owner, ownerType string, projectNumber int, spec batchFieldSpec) (*ResolvedField, error) {\n\tif spec.name != \"\" {\n\t\treturn resolveProjectFieldByName(ctx, gqlClient, owner, ownerType, projectNumber, spec.name, \"\")\n\t}\n\n\tfields, err := listAllProjectFields(ctx, gqlClient, owner, ownerType, projectNumber)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tid := fmt.Sprintf(\"%d\", spec.id)\n\tfor _, field := range fields {","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/projects_batch.go#L512-L548","documentation":"Raised by parseBatchFieldSpec (pkg/github/projects_batch.go:530) when updated_field uses the name form but the value is not a non-empty string — null, a number, a bool, or \"\". The field name must exactly match the Project V2 field's name; this error, however, fires earlier, on the type/emptiness check, and fails the whole request.","triggerScenarios":"\"updated_field\": {\"name\": null, \"value\": \"Done\"}, {\"name\": \"\"} from a blank config value, or {\"name\": 42}. All fail the string type assertion or the empty check at line 529.","commonSituations":"Empty template variables for the field name; config where the field name was never set and serialized as null; numeric field names from internal keys forwarded without mapping to the display name.","solutions":["Set name to the exact field name as a non-empty string, e.g. \"Status\"","Fetch field names first via the list-project-fields tool and copy the exact spelling/case","Guard configs: skip or fail fast when the configured field name is blank","If you only have the numeric field database ID, use the id form instead"],"exampleFix":"// before\n{\"updated_field\": {\"name\": \"\", \"value\": \"Done\"}}\n// after\n{\"updated_field\": {\"name\": \"Status\", \"value\": \"Done\"}}","handlingStrategy":"validation","validationCode":"if v, ok := spec[\"name\"]; ok {\n\ts, isStr := v.(string)\n\tif !isStr || s == \"\" {\n\t\treturn fmt.Errorf(\"updated_field.name must be a non-empty string\")\n\t}\n}","typeGuard":"func isNonEmptyString(v any) bool { s, ok := v.(string); return ok && s != \"\" }","tryCatchPattern":null,"preventionTips":["Copy the exact field name (case-sensitive) from list_project_fields","Fail fast on blank configured field names at startup","If only a numeric ID is known, use the id form instead"],"tags":["github-projects","batch","input-validation","type-mismatch","updated-field"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}