# PingCAP Portal Custom Fields

这是一个面向 Jira Service Management Portal 的 Atlassian Forge UI Kit 应用，提供三个生产级自定义字段：

- `TiDB Cloud Org`：展示请求客户可访问的 TiDB Cloud 组织。
- `TiDB Cloud Cluster`：与 Org 联动，只展示所选组织下的 Cluster。
- `TiDB Cloud Lake`：与 Org 联动，只展示所选组织下的 Lake。


## 字段存储

字段保存当前选中的完整资源对象，属性名与 Query API 文档保持一致。

Org 正常 API 选择后的完整示例：

```json
{
  "tidbcloud_org_id": "12345",
  "name": "Demo Org",
  "status": "active",
  "support_plan": "Premium",
  "plan": "on_demand",
  "jsm_org_id": "123",
  "biz_region": "NA",
  "time_zone": "America/Los_Angeles",
  "msp_org": {
    "tidbcloud_org_id": "11111",
    "name": "Demo MSP",
    "msp_notification_enabled": true,
    "msp_members": [
      "msp-admin@example.com"
    ]
  }
}
```

Cluster 正常 API 选择后的完整示例：

```json
{
  "id": "123",
  "name": "prod",
  "status": "AVAILABLE",
  "service_plan": "Premium",
  "tidbcloud_org_id": "12345"
}
```

Lake 正常 API 选择后的完整示例：

```json
{
  "id": "lake-123",
  "name": "prod-lake",
  "tier": "Business",
  "support_plan": "Enterprise",
  "tidbcloud_org_id": "12345",
  "status": "Active"
}
```

## 必填字段回退

TiDB Cloud 查询失败且字段没有已保存真实值时，应用提交最小保留对象：

Org：

```json
{
  "tidbcloud_org_id": "-1"
}
```

Cluster/Lake：

```json
{
  "id": "-1"
}
```

客户仍可提交必填表单，后续由支持工程师补全。保留值不会发送到真实 Org、Cluster 或 Lake 查询接口，Portal 也不会向客户展示基础设施错误。
