Skip to content

Commit 338f40f

Browse files
committed
Clarify updated field schema guidance
Separate method, identifier, and typed value rules so clients can choose the correct updated_field variant. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1d574277-3735-4356-a753-8354aa6b537c
1 parent 965fd8a commit 338f40f

3 files changed

Lines changed: 13 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ The following sets of tools are available:
11331133
- `status`: The status of the project. Used for 'create_project_status_update' method. (string, optional)
11341134
- `target_date`: The target date of the status update in YYYY-MM-DD format. Used for 'create_project_status_update' method. (string, optional)
11351135
- `title`: The project title. Required for 'create_project' method. (string, optional)
1136-
- `updated_field`: The field/value to apply, using {"id": 123, "value": ...} or {"name": "Status", "value": ...}; null clears the field. Required for 'update_project_item' and 'update_project_items', where one top-level field/value applies to every item in a batch. For 'update_project_item', the name form supports attached Issue Fields on Issue items and accepts SINGLE_SELECT option names case-insensitively. Attached Issue Fields are not supported by 'update_project_items'; use singular 'update_project_item'. The ID form addresses standard Project fields and expects an option ID for SINGLE_SELECT. (object, optional)
1136+
- `updated_field`: The field to update and its new value. Required for 'update_project_item' and 'update_project_items'. For 'update_project_items', one top-level field/value applies to every item. Set value to null to clear the field. (object, optional)
11371137

11381138
</details>
11391139

pkg/github/__toolsnaps__/projects_write.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,17 @@
186186
"type": "string"
187187
},
188188
"updated_field": {
189-
"description": "The field/value to apply, using {\"id\": 123, \"value\": ...} or {\"name\": \"Status\", \"value\": ...}; null clears the field. Required for 'update_project_item' and 'update_project_items', where one top-level field/value applies to every item in a batch. For 'update_project_item', the name form supports attached Issue Fields on Issue items and accepts SINGLE_SELECT option names case-insensitively. Attached Issue Fields are not supported by 'update_project_items'; use singular 'update_project_item'. The ID form addresses standard Project fields and expects an option ID for SINGLE_SELECT.",
189+
"description": "The field to update and its new value. Required for 'update_project_item' and 'update_project_items'. For 'update_project_items', one top-level field/value applies to every item. Set value to null to clear the field.",
190190
"oneOf": [
191191
{
192192
"additionalProperties": false,
193193
"properties": {
194194
"id": {
195-
"description": "The numeric project field ID.",
195+
"description": "The numeric ID of a standard Project field. Attached Issue Fields must be updated by name with singular 'update_project_item'.",
196196
"type": "integer"
197197
},
198198
"value": {
199-
"description": "The value to apply. Any JSON value is accepted; use null to clear the field."
199+
"description": "The new value, or null to clear the field. For SINGLE_SELECT, use the option ID."
200200
}
201201
},
202202
"required": [
@@ -209,11 +209,11 @@
209209
"additionalProperties": false,
210210
"properties": {
211211
"name": {
212-
"description": "The project field name. Matching is case-insensitive.",
212+
"description": "The case-insensitive field name. Supports standard Project fields. Singular 'update_project_item' also supports attached Issue Fields; 'update_project_items' does not.",
213213
"type": "string"
214214
},
215215
"value": {
216-
"description": "The value to apply. Any JSON value is accepted; use null to clear the field."
216+
"description": "The new value, or null to clear the field. Use a string for TEXT, a finite number for NUMBER, a YYYY-MM-DD string for DATE, and an option name (case-insensitive) or option ID for SINGLE_SELECT."
217217
}
218218
},
219219
"required": [

pkg/github/projects.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,8 @@ func updateProjectItemsItemSchema() *jsonschema.Schema {
536536
}
537537

538538
func projectUpdatedFieldSchema() *jsonschema.Schema {
539-
value := &jsonschema.Schema{
540-
Description: "The value to apply. Any JSON value is accepted; use null to clear the field.",
541-
}
542-
variant := func(required []string, properties map[string]*jsonschema.Schema) *jsonschema.Schema {
543-
properties["value"] = value
539+
variant := func(required []string, properties map[string]*jsonschema.Schema, valueDescription string) *jsonschema.Schema {
540+
properties["value"] = &jsonschema.Schema{Description: valueDescription}
544541
return &jsonschema.Schema{
545542
Type: "object",
546543
AdditionalProperties: &jsonschema.Schema{Not: &jsonschema.Schema{}},
@@ -551,20 +548,20 @@ func projectUpdatedFieldSchema() *jsonschema.Schema {
551548

552549
return &jsonschema.Schema{
553550
Type: "object",
554-
Description: "The field/value to apply, using {\"id\": 123, \"value\": ...} or {\"name\": \"Status\", \"value\": ...}; null clears the field. Required for 'update_project_item' and 'update_project_items', where one top-level field/value applies to every item in a batch. For 'update_project_item', the name form supports attached Issue Fields on Issue items and accepts SINGLE_SELECT option names case-insensitively. Attached Issue Fields are not supported by 'update_project_items'; use singular 'update_project_item'. The ID form addresses standard Project fields and expects an option ID for SINGLE_SELECT.",
551+
Description: "The field to update and its new value. Required for 'update_project_item' and 'update_project_items'. For 'update_project_items', one top-level field/value applies to every item. Set value to null to clear the field.",
555552
OneOf: []*jsonschema.Schema{
556553
variant([]string{"id", "value"}, map[string]*jsonschema.Schema{
557554
"id": {
558555
Type: "integer",
559-
Description: "The numeric project field ID.",
556+
Description: "The numeric ID of a standard Project field. Attached Issue Fields must be updated by name with singular 'update_project_item'.",
560557
},
561-
}),
558+
}, "The new value, or null to clear the field. For SINGLE_SELECT, use the option ID."),
562559
variant([]string{"name", "value"}, map[string]*jsonschema.Schema{
563560
"name": {
564561
Type: "string",
565-
Description: "The project field name. Matching is case-insensitive.",
562+
Description: "The case-insensitive field name. Supports standard Project fields. Singular 'update_project_item' also supports attached Issue Fields; 'update_project_items' does not.",
566563
},
567-
}),
564+
}, "The new value, or null to clear the field. Use a string for TEXT, a finite number for NUMBER, a YYYY-MM-DD string for DATE, and an option name (case-insensitive) or option ID for SINGLE_SELECT."),
568565
},
569566
}
570567
}

0 commit comments

Comments
 (0)