Skip to content

Commit 814ccba

Browse files
committed
fix(change-requests): include nested attributes for API payload
1 parent 4d2cdeb commit 814ccba

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

content/terraform-docs-common/docs/cloud-docs/api-docs/change-requests.mdx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,12 @@ You must specify the following fields in your payload when creating a new change
250250

251251
| Key path | Type | Required | Description |
252252
|------------|------|---------|-------------|
253-
| `data.action_type` | string | Required | The action to take. To create a change request, specify `"change_request"`. |
254-
| `data.action_inputs` | object | Required | Arguments for the bulk action. |
255-
| `data.action_inputs.subject` | string | Required | The change request's subject line.
256-
| `data.action_inputs.message` | string | Required | The change request's message, which HCP Terraform treats as markdown. |
257-
| `data.target_ids` | array | Optional | The IDs of the workspace you want to associate with this change request. You do not need to specify this field if you provide `data.query`. |
258-
| `data.query` | object | Optional | An [explorer query](/terraform/cloud-docs/api-docs/explorer#execute-a-query) with workspace data. You do not need to specify this field if you provide `data.target_ids`. |
253+
| `data.attributes.action_type` | string | Required | The action to take. To create a change request, specify `"change_request"`. |
254+
| `data.attributes.action_inputs` | object | Required | Arguments for the bulk action. |
255+
| `data.attributes.action_inputs.subject` | string | Required | The change request's subject line.
256+
| `data.attributes.action_inputs.message` | string | Required | The change request's message, which HCP Terraform treats as markdown. |
257+
| `data.attributes.target_ids` | array | Optional | The IDs of the workspace you want to associate with this change request. You do not need to specify this field if you provide `data.attribute.query`. |
258+
| `data.attributes.query` | object | Optional | An [explorer query](/terraform/cloud-docs/api-docs/explorer#execute-a-query) with workspace data. You do not need to specify this field if you provide `data.attribute.target_ids`. |
259259

260260
### Sample Payload
261261

@@ -269,14 +269,18 @@ You must specify the following fields in your payload when creating a new change
269269
"subject": "[Action Required] Github Actions Pinning (SEC-090)",
270270
"message": "Some long description here",
271271
},
272-
"query": {
273-
"type": "workspaces",
274-
"filter": [
275-
"field": "workspace_name",
276-
"operator": "contains",
277-
"value": ["dev"]
278-
]
279-
}
272+
"query": {
273+
"type": "workspaces",
274+
"filter": [
275+
{
276+
"workspace_name": {
277+
"contains": [
278+
"dev"
279+
]
280+
}
281+
}
282+
]
283+
}
280284
},
281285
}
282286
```

0 commit comments

Comments
 (0)