{
  "slug": "pulumi-policy-issue-ls-filters-and-sorts-issues-export-writes-csv-ce182b99d7ae",
  "title": "pulumi policy issue ls filters and sorts issues; export writes CSV",
  "tools": [
    "pulumi"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-11-04T12:04:08.000Z",
  "announced_at": "2026-11-04T12:04:08.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When you need to find policy issues matching criteria, use `pulumi policy issue ls` with filters and sorting. To report matching issues as CSV, use `pulumi policy issue export`, writing to stdout or a file.",
    "examples": [
      "pulumi policy issue ls --severity high --severity critical --status open",
      "pulumi policy issue ls --stack <project>/<stack> --sort observedAt:desc --output json",
      "pulumi policy issue export --severity critical --status open --assigned-to <login> --file <path.csv>"
    ],
    "gotchas": [
      "Version: 3.274.0",
      "Non-interactive: List output defaults to a human-readable table; `--output json` returns a JSON envelope. Export writes CSV to stdout unless `--file` is set. Filters are validated before cloud login resolution.",
      "--severity, --priority, --status, --pack, --policy, --group, --stack, --account, --resource-type, --urn, --assigned-to: Filter issues; flags can be repeated.",
      "--sort: Sort by column, optionally `:asc` or `:desc`.",
      "--file: Write export CSV to this file instead of stdout.",
      "--output: Set list output format; `json` returns the full response as a JSON envelope.",
      "Repeating a flag means OR; different flags mean AND.",
      "Enum values are checked against the generated API enums, and all values are validated before any login or network call.",
      "With no flags, the request body is unchanged.",
      "`--stack` maps to the stack entity's project and name, and `--account` to the Insights account entity.",
      "Export writes matching issues as CSV to stdout or `--file`."
    ]
  },
  "why_it_matters": "Find and export policy issues matching criteria while reviewing or reporting repository policy findings.",
  "before": "Run `pulumi policy issue ls` without these filters and page through the organization's active issues; export issues from the CLI was unavailable.",
  "sources": [
    "https://github.com/pulumi/pulumi/releases/tag/v3.274.0",
    "https://github.com/pulumi/pulumi/pull/25333",
    "https://github.com/pulumi/pulumi/blob/v3.274.0/pkg/cmd/pulumi/policy/policy_issue_list.go",
    "https://github.com/pulumi/pulumi/blob/v3.274.0/pkg/cmd/pulumi/policy/policy_issue_export.go"
  ],
  "rank": 0.98053,
  "review_state": "approved",
  "provenance": {
    "run_id": "daily-20261104-13",
    "verdict_id": "daily-20261104-13:daily-20261104-13-0e9c7e0cf571a3f0-9:gate",
    "evidence_hash": "2dc467742e6ac0a9687cb2d7cd0d82169d458e92d94476c1c90ec83f5f4dbe02"
  }
}
