{
  "id": "k-camp-12",
  "title": "Workflow action Campaign options hydrate saved labels",
  "kind": "hubspot_sync",
  "caseTimeoutMs": 180000,
  "provenance": {
    "businessScenario": "Regression for HubSpot workflow editor Campaign labels after save. HubSpot stores only the selected Campaign enum value in the workflow action fields, then renders actionCardContent by resolving that value through the dynamic Campaign options endpoint. If the adapter only returns the first default option page and cannot hydrate a saved value directly, the workflow canvas shows '<id> (missing label)' even though the Campaign exists.",
    "endpointContract": "GET /hubspot/workflow-actions/options/campaigns with options_token injected by the runner. The adapter must support search q=<term> and selected value hydration via value=<CampaignId>. Response shape: {searchable:true, options:[{label,value}], after?:string}.",
    "reportedBy": "HubSpot workflow editor canvas - saved Campaign rendered as '<CampaignId> (missing label)' after selecting a searchable Campaign outside the initial dropdown page.",
    "capturedAt": "2026-06-29",
    "assertionModel": "s0 creates an environment-local Campaign with a unique run id so the case is not tied to staging fixture data. s1 proves that search can locate the Campaign by run id. s2 is the missing-label regression check: HubSpot action-card rendering can rehydrate the saved Campaign Id into the expected label through value=<CampaignId>."
  },
  "steps": [
    {
      "id": "s0-create-campaign",
      "system": "nexuscrm",
      "authRole": "admin",
      "method": "POST",
      "path": "/services/data/v63.0/sobjects/Campaign",
      "body": {
        "Name": "IT K-CAMP-12 saved-label {{__runId}}",
        "IsActive": true
      },
      "expectStatusRange": [
        200,
        299
      ],
      "assertions": [
        {
          "path": "response.body.id",
          "exists": true
        }
      ]
    },
    {
      "id": "s1-search-finds-created-campaign",
      "system": "connector_options",
      "method": "GET",
      "path": "/hubspot/workflow-actions/options/campaigns?q={{__runId}}",
      "expectStatus": 200,
      "poll": {
        "budgetMs": 60000,
        "intervalMs": 8000
      },
      "onTimeout": "fail",
      "assertions": [
        {
          "path": "response.body.searchable",
          "equals": true
        },
        {
          "path": "response.body.options",
          "arrayContainsObject": {
            "value": "{{steps.s0-create-campaign.response.body.id}}",
            "label": "IT K-CAMP-12 saved-label {{__runId}}"
          }
        }
      ]
    },
    {
      "id": "s2-selected-value-hydrates-label",
      "system": "connector_options",
      "method": "GET",
      "path": "/hubspot/workflow-actions/options/campaigns?value={{steps.s0-create-campaign.response.body.id}}",
      "expectStatus": 200,
      "poll": {
        "budgetMs": 60000,
        "intervalMs": 8000
      },
      "onTimeout": "fail",
      "assertions": [
        {
          "path": "response.body.options",
          "arrayContainsObject": {
            "value": "{{steps.s0-create-campaign.response.body.id}}",
            "label": "IT K-CAMP-12 saved-label {{__runId}}"
          }
        }
      ]
    }
  ]
}
