Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

MUL-7037 feat(cli): resolve custom property names in issue JSON (#8008)

Firer7a3f8b3f52d3
diff --git a/CLI_AND_DAEMON.md b/CLI_AND_DAEMON.md
index c4c4582f00..f13066623b 100644
--- a/CLI_AND_DAEMON.md
+++ b/CLI_AND_DAEMON.md
@@ -504,6 +504,7 @@ multica issue list --limit 20 --output json
multica issue list --status todo --sort position # board order (the default)
multica issue list --sort created_at --direction desc # newest first
multica issue list --output json --fields=id,title,status,priority # narrow the JSON payload
+multica issue list --output json --resolve-properties # property names beside the ids
```
Table output shows a routable issue `KEY` such as `MUL-123`; copy that key into follow-up commands like `issue get`, `issue comment list`, `issue status`, or `--parent`. Add `--full-id` when you need canonical UUIDs. Available filters: `--status`, `--priority`, `--assignee` / `--assignee-id`, `--project`, `--metadata`, `--property`, `--limit`. Use `--assignee-id <uuid>` for unambiguous filtering when names overlap.
@@ -527,11 +528,18 @@ multica issue list --property "Impact=__none__" --status in_review
multica issue list --property "Score=42" --property "Ship Date=2026-08-28"
```
+In JSON output, `properties` is a map from definition id to the stored value: an option id for `select`, a list of option ids for `multi_select`, a `member:<uuid>` reference for the actor types, and the value itself otherwise. Pass `--resolve-properties` to replace that map with the rows `issue property list` prints, one per set property, in catalog order: `property_id`, `name`, `type`, the stored `value`, a human `display`, `display_values` (the per-item names of a `multi_select` or `multi_actor` value) and `archived` when the definition is archived. Archived definitions still resolve, since their values stay on the issue. An option that is no longer in the definition, or a member who has left the workspace, keeps its raw id in `display`. The flag adds at most two requests: the catalog, shared with `--property` and `--sort property:`, and the member list, fetched only when an actor `--property` filter or an actor value on the page needs it and shared between the two. If either request fails the command fails rather than printing ids. In JSON output it combines with `--fields` only when that list keeps `properties`; a `--fields` list without it is rejected rather than resolving a key the same command would delete. The flag has no effect on `--output table`, where it and `--fields` are both ignored and neither is rejected.
+
+```bash
+multica issue list --output json --resolve-properties | jq '.issues[] | {identifier, properties: [.properties[]? | {name, display}]}'
+```
+
### Get Issue
```bash
multica issue get <id>
multica issue get <id> --output json
+multica issue get <id> --resolve-properties # property names beside the ids, as in issue list
```
### Create Issue
diff --git a/apps/docs/content/docs/cli.ja.mdx b/apps/docs/content/docs/cli.ja.mdx
index 0afc1cd32d..9a687f7be0 100644
--- a/apps/docs/content/docs/cli.ja.mdx
+++ b/apps/docs/content/docs/cli.ja.mdx
@@ -224,8 +224,8 @@ CLI の設定ファイルには、あなたとして Multica にアクセスで
| コマンド | サブコマンド | 用途 | 主なフラグ |
| --- | --- | --- | --- |
-| `issue` | `list` | タスクを一覧 | `--status`、`--priority`、`--assignee`、`--project`、`--metadata`(繰り返し可)、`--property`(繰り返し可、`"名前=値"`;`__none__` は未設定に一致)、`--limit`、`--offset`、`--sort`(`property:<名前または id>` に対応)、`--full-id` |
-| | `get <id>` | 単一のタスクを表示 | |
+| `issue` | `list` | タスクを一覧 | `--status`、`--priority`、`--assignee`、`--project`、`--metadata`(繰り返し可)、`--property`(繰り返し可、`"名前=値"`;`__none__` は未設定に一致)、`--limit`、`--offset`、`--sort`(`property:<名前または id>` に対応)、`--full-id`、`--resolve-properties`(JSON のみ;保存された id に加えてプロパティ名・選択肢名・メンバー名を返します) |
+| | `get <id>` | 単一のタスクを表示 | `--resolve-properties`(JSON のみ;保存された id に加えてプロパティ名・選択肢名・メンバー名を返します) |
| | `create` | タスクを作成 | `--title`(必須)、`--description` / `--description-stdin` / `--description-file`、`--status`、`--priority`、`--assignee`、`--parent`、`--stage`、`--project`、`--start-date`、`--due-date`、`--attachment`(繰り返し可) |
| | `update <id>` | タスクのフィールドを更新 | `create` と同系のフィールドに加え `--position`、`--no-start` |
| | `assign <id>` | 割り当てまたは割り当て解除 | `--to`(メンバー、エージェント、スクワッドを名前であいまいマッチ)、`--to-id`、`--unassign`、`--no-start` |
diff --git a/apps/docs/content/docs/cli.ko.mdx b/apps/docs/content/docs/cli.ko.mdx
index 8d09c249d8..ee5f6234ab 100644
--- a/apps/docs/content/docs/cli.ko.mdx
+++ b/apps/docs/content/docs/cli.ko.mdx
@@ -224,8 +224,8 @@ CLI 설정 파일에는 사용자를 대신해 Multica에 접근할 수 있는 t
| 명령 | 하위 명령 | 용도 | 주요 flag |
| --- | --- | --- | --- |
-| `issue` | `list` | 태스크 목록 | `--status`, `--priority`, `--assignee`, `--project`, `--metadata`(반복 가능), `--property`(반복 가능, `"이름=값"`; `__none__`은 미설정과 일치), `--limit`, `--offset`, `--sort`(`property:<이름 또는 id>` 지원), `--full-id` |
-| | `get <id>` | 태스크 하나 확인 | |
+| `issue` | `list` | 태스크 목록 | `--status`, `--priority`, `--assignee`, `--project`, `--metadata`(반복 가능), `--property`(반복 가능, `"이름=값"`; `__none__`은 미설정과 일치), `--limit`, `--offset`, `--sort`(`property:<이름 또는 id>` 지원), `--full-id`, `--resolve-properties`(JSON 전용; 저장된 id와 함께 속성, 옵션, 멤버 이름을 반환) |
+| | `get <id>` | 태스크 하나 확인 | `--resolve-properties`(JSON 전용; 저장된 id와 함께 속성, 옵션, 멤버 이름을 반환) |
| | `create` | 태스크 생성 | `--title`(필수), `--description` / `--description-stdin` / `--description-file`, `--status`, `--priority`, `--assignee`, `--parent`, `--stage`, `--project`, `--start-date`, `--due-date`, `--attachment`(반복 가능) |
| | `update <id>` | 태스크 필드 업데이트 | `create`와 같은 종류의 필드에 `--position`, `--no-start` 추가 |
| | `assign <id>` | 할당 또는 할당 해제 | `--to`(이름으로 멤버, 에이전트, 스쿼드 fuzzy match), `--to-id`, `--unassign`, `--no-start` |
diff --git a/apps/docs/content/docs/cli.mdx b/apps/docs/content/docs/cli.mdx
index 8c5d10f8b4..9919e733cc 100644
--- a/apps/docs/content/docs/cli.mdx
+++ b/apps/docs/content/docs/cli.mdx
@@ -232,8 +232,8 @@ The tables below cover every current top-level command, grouped the way the CLI
| Command | Subcommand | Purpose | Key flags |
| --- | --- | --- | --- |
-| `issue` | `list` | List issues | `--status`, `--priority`, `--assignee`, `--project`, `--metadata` (repeatable), `--property` (repeatable, `"Name=Value"`; `__none__` matches unset), `--limit`, `--offset`, `--sort` (incl. `property:<name-or-id>`), `--full-id` |
-| | `get <id>` | Show a single issue | |
+| `issue` | `list` | List issues | `--status`, `--priority`, `--assignee`, `--project`, `--metadata` (repeatable), `--property` (repeatable, `"Name=Value"`; `__none__` matches unset), `--limit`, `--offset`, `--sort` (incl. `property:<name-or-id>`), `--full-id`, `--resolve-properties` (JSON only; rows with property, option and member names beside the stored ids) |
+| | `get <id>` | Show a single issue | `--resolve-properties` (JSON only; rows with property, option and member names beside the stored ids) |
| | `create` | Create an issue | `--title` (required), `--description` / `--description-stdin` / `--description-file`, `--status`, `--priority`, `--assignee`, `--parent`, `--stage`, `--project`, `--start-date`, `--due-date`, `--attachment` (repeatable) |
| | `update <id>` | Update issue fields | Same fields as `create`, plus `--position`, `--no-start` |
| | `assign <id>` | Assign or unassign | `--to` (fuzzy name match against members, agents, and squads), `--to-id`, `--unassign`, `--no-start` |
diff --git a/apps/docs/content/docs/cli.zh.mdx b/apps/docs/content/docs/cli.zh.mdx
index 0372c708fb..2739d651ad 100644
--- a/apps/docs/content/docs/cli.zh.mdx
+++ b/apps/docs/content/docs/cli.zh.mdx
@@ -224,8 +224,8 @@ CLI 配置文件包含可代表你访问 Multica 的令牌。不要提交到仓
| 命令 | 子命令 | 用途 | 关键 flag |
| --- | --- | --- | --- |
-| `issue` | `list` | 列出任务 | `--status`、`--priority`、`--assignee`、`--project`、`--metadata`(可重复)、`--property`(可重复,`"名称=值"`;`__none__` 匹配未设置)、`--limit`、`--offset`、`--sort`(支持 `property:<名称或 id>`)、`--full-id` |
-| | `get <id>` | 查看单个任务 | |
+| `issue` | `list` | 列出任务 | `--status`、`--priority`、`--assignee`、`--project`、`--metadata`(可重复)、`--property`(可重复,`"名称=值"`;`__none__` 匹配未设置)、`--limit`、`--offset`、`--sort`(支持 `property:<名称或 id>`)、`--full-id`、`--resolve-properties`(仅 JSON;在保存的 id 旁附上属性、选项和成员名称) |
+| | `get <id>` | 查看单个任务 | `--resolve-properties`(仅 JSON;在保存的 id 旁附上属性、选项和成员名称) |
| | `create` | 创建任务 | `--title`(必填)、`--description` / `--description-stdin` / `--description-file`、`--status`、`--priority`、`--assignee`、`--parent`、`--stage`、`--project`、`--start-date`、`--due-date`、`--attachment`(可重复) |
| | `update <id>` | 更新任务字段 | 与 `create` 同类字段,另有 `--position`、`--no-start` |
| | `assign <id>` | 指派或取消指派 | `--to`(名称模糊匹配成员、智能体或小队)、`--to-id`、`--unassign`、`--no-start` |
diff --git a/server/cmd/multica/cmd_issue.go b/server/cmd/multica/cmd_issue.go
index a38df82f30..da2e81719d 100644
--- a/server/cmd/multica/cmd_issue.go
+++ b/server/cmd/multica/cmd_issue.go
@@ -517,9 +517,11 @@ func init() {
issueListCmd.Flags().String("sort", "", "Sort column: position (default, manual board order), title, created_at, start_date, due_date, priority, or property:<name-or-id> to sort by a custom property (select properties sort by option order)")
issueListCmd.Flags().String("direction", "", "Sort direction (asc or desc); requires --sort to be a non-position column or a property sort (position is always ascending)")
issueListCmd.Flags().String("fields", "", "JSON output only: comma-separated list of issue fields to include (e.g. id,title,status,priority). Filtering happens client-side after the full response is fetched, so this shrinks CLI output size and agent context cost, not network/server-side cost. Omit for the full issue object (default, unchanged). Valid fields: "+strings.Join(validIssueFields, ", "))
+ issueListCmd.Flags().Bool("resolve-properties", false, resolvePropertiesHelp)
// issue get
issueGetCmd.Flags().String("output", "json", "Output format: table or json")
+ issueGetCmd.Flags().Bool("resolve-properties", false, resolvePropertiesHelp)
// issue pull-requests
issuePullRequestsCmd.Flags().String("output", "table", "Output format: table or json")
@@ -699,11 +701,13 @@ func runIssueList(cmd *cobra.Command, _ []string) error {
params.Set("metadata", filter)
}
// --property filtering and property:<ref> sorting both address definitions
- // by name or UUID, so they share a single catalog fetch.
+ // by name or UUID, so they share a single catalog fetch. An actor filter
+ // and --resolve-properties share one member request the same way.
const propertySortPrefix = "property:"
propertyFlags, _ := cmd.Flags().GetStringArray("property")
sortVal, _ := cmd.Flags().GetString("sort")
var properties []propertyDTO
+ var members memberDirectory
if len(propertyFlags) > 0 || strings.HasPrefix(sortVal, propertySortPrefix) {
var err error
if properties, err = fetchProperties(ctx, client); err != nil {
@@ -711,7 +715,7 @@ func runIssueList(cmd *cobra.Command, _ []string) error {
}
}
if len(propertyFlags) > 0 {
- filter, err := buildPropertiesFilterQueryParam(ctx, client, properties, propertyFlags)
+ filter, err := buildPropertiesFilterQueryParam(ctx, client, &members, properties, propertyFlags)
if err != nil {
return err
}
@@ -757,13 +761,32 @@ func runIssueList(cmd *cobra.Command, _ []string) error {
for _, f := range validIssueFields {
valid[f] = true
}
+ keepsProperties := false
for _, f := range strings.Split(v, ",") {
f = strings.TrimSpace(f)
if !valid[f] {
return fmt.Errorf("invalid --fields value %q; valid values: %s", f, strings.Join(validIssueFields, ", "))
}
+ if f == "properties" {
+ keepsProperties = true
+ }
fields = append(fields, f)
}
+ // --fields without `properties` deletes the very key
+ // --resolve-properties rewrites, so the pair would either cost two
+ // requests for output nobody sees or leave the flag silently doing
+ // nothing. A passed-but-ignored flag is a footgun in scripts (the
+ // same reason --fields rejects "assignee" instead of dropping it),
+ // so say so instead of picking one of those.
+ //
+ // Only in JSON mode, though: both flags document themselves as having
+ // no effect on --output table, so a table reader who leaves them on
+ // the command line must still get their table.
+ outputFormat, _ := cmd.Flags().GetString("output")
+ resolve, _ := cmd.Flags().GetBool("resolve-properties")
+ if outputFormat == "json" && resolve && !keepsProperties {
+ return fmt.Errorf("--resolve-properties needs the properties field, but --fields does not include it; add properties to --fields or drop --resolve-properties")
+ }
}
path := "/api/issues"
@@ -780,9 +803,18 @@ func runIssueList(cmd *cobra.Command, _ []string) error {
output, _ := cmd.Flags().GetString("output")
if output == "json" {
+ // --fields runs first so a page that drops `properties` never pays for
+ // the catalog and member requests resolving it would need. Combining
+ // the two with `properties` filtered out is rejected above, so nothing
+ // resolvable is deleted before it is resolved.
if len(fields) > 0 {
filterIssueFields(issuesRaw, fields)
}
+ if resolve, _ := cmd.Flags().GetBool("resolve-properties"); resolve {
+ if err := resolveIssueProperties(ctx, client, properties, &members, issuesRaw); err != nil {
+ return err
+ }
+ }
total, _ := result["total"].(float64)
limit, _ := cmd.Flags().GetInt("limit")
offset, _ := cmd.Flags().GetInt("offset")
@@ -953,6 +985,11 @@ func runIssueGet(cmd *cobra.Command, args []string) error {
return nil
}
+ if resolve, _ := cmd.Flags().GetBool("resolve-properties"); resolve {
+ if err := resolveIssueProperties(ctx, client, nil, &memberDirectory{}, []any{issue}); err != nil {
+ return err
+ }
+ }
return cli.PrintJSON(os.Stdout, issue)
}
@@ -2739,52 +2776,48 @@ func (k assigneeKinds) describe() string {
}
}
+// assigneeCandidate is one directory entry matchAssignee ranks. aliases are
+// additional unique identifiers that select a candidate outright, ranked with
+// id matches rather than name matches — a member's email is as unambiguous as
+// their id, and is what people actually have to hand. Without it,
+// `--value [email protected]` fails to resolve.
+type assigneeCandidate struct {
+ assigneeMatch
+ aliases []string
+}
+
+func (c assigneeCandidate) matchesAlias(input string) bool {
+ for _, alias := range c.aliases {
+ if alias != "" && strings.EqualFold(alias, input) {
+ return true
+ }
+ }
+ return false
+}
+
+func memberCandidates(members []map[string]any) []assigneeCandidate {
+ candidates := make([]assigneeCandidate, 0, len(members))
+ for _, m := range members {
+ candidates = append(candidates, assigneeCandidate{
+ assigneeMatch: assigneeMatch{Type: "member", ID: strVal(m, "user_id"), Name: strVal(m, "name")},
+ aliases: []string{strVal(m, "email")},
+ })
+ }
+ return candidates
+}
+
func resolveAssignee(ctx context.Context, client *cli.APIClient, name string, kinds assigneeKinds) (string, string, error) {
if client.WorkspaceID == "" {
return "", "", fmt.Errorf("workspace ID is required to resolve assignees; use --workspace-id or set MULTICA_WORKSPACE_ID")
}
-
- input := normalizeAssigneeLookupInput(name)
- if input == "" {
+ if normalizeAssigneeLookupInput(name) == "" {
return "", "", fmt.Errorf("no %s found matching %q", kinds.describe(), name)
}
- inputLower := strings.ToLower(input)
- // Matches are collected into three priority buckets. Higher-priority buckets
- // short-circuit lower-priority matching so that, e.g., an exact name match
- // always wins over a substring collision with another candidate.
- // 1. idMatches — full UUID or 8-char ShortID (as shown by `truncateID`).
- // 2. exactMatches — case-insensitive full name equality.
- // 3. substringMatches — preserves the existing partial-name UX.
- var idMatches, exactMatches, substringMatches []assigneeMatch
+ var candidates []assigneeCandidate
var errs []error
var fetchAttempts int
- // exactAliases are additional unique identifiers that select a candidate
- // outright, ranked with id matches rather than name matches — a member's
- // email is as unambiguous as their id, and is what people actually have to
- // hand. Without it, `--value [email protected]` fails to resolve.
- classify := func(entityType, id, displayName string, exactAliases ...string) {
- match := assigneeMatch{Type: entityType, ID: id, Name: displayName}
- if id != "" && (strings.EqualFold(id, input) || strings.EqualFold(truncateID(id), input)) {
- idMatches = append(idMatches, match)
- return
- }
- for _, alias := range exactAliases {
- if alias != "" && strings.EqualFold(alias, input) {
- idMatches = append(idMatches, match)
- return
- }
- }
- if strings.EqualFold(displayName, input) {
- exactMatches = append(exactMatches, match)
- return
- }
- if strings.Contains(strings.ToLower(displayName), inputLower) {
- substringMatches = append(substringMatches, match)
- }
- }
-
// Search members.
if kinds.member {
fetchAttempts++
@@ -2792,9 +2825,7 @@ func resolveAssignee(ctx context.Context, client *cli.APIClient, name string, ki
if err := getAssigneeJSON(ctx, client, "/api/workspaces/"+client.WorkspaceID+"/members", &members); err != nil {
errs = append(errs, fmt.Errorf("fetch members: %w", err))
} else {
- for _, m := range members {
- classify("member", strVal(m, "user_id"), strVal(m, "name"), strVal(m, "email"))
- }
+ candidates = append(candidates, memberCandidates(members)...)
}
}
@@ -2807,7 +2838,7 @@ func resolveAssignee(ctx context.Context, client *cli.APIClient, name string, ki
errs = append(errs, fmt.Errorf("fetch agents: %w", err))
} else {
for _, a := range agents {
- classify("agent", strVal(a, "id"), strVal(a, "name"))
+ candidates = append(candidates, assigneeCandidate{assigneeMatch: assigneeMatch{Type: "agent", ID: strVal(a, "id"), Name: strVal(a, "name")}})
}
}
}
@@ -2829,7 +2860,7 @@ func resolveAssignee(ctx context.Context, client *cli.APIClient, name string, ki
if strVal(s, "archived_at") != "" {
continue
}
- classify("squad", strVal(s, "id"), strVal(s, "name"))
+ candidates = append(candidates, assigneeCandidate{assigneeMatch: assigneeMatch{Type: "squad", ID: strVal(s, "id"), Name: strVal(s, "name")}})
}
}
}
@@ -2843,6 +2874,37 @@ func resolveAssignee(ctx context.Context, client *cli.APIClient, name string, ki
return "", "", fmt.Errorf("failed to resolve assignee: %s", strings.Join(msgs, "; "))
}
+ return matchAssignee(name, kinds, candidates)
+}
+
+// matchAssignee resolves name against candidates a caller already fetched.
+// Matches are collected into three priority buckets. Higher-priority buckets
+// short-circuit lower-priority matching so that, e.g., an exact name match
+// always wins over a substring collision with another candidate.
+// 1. idMatches — full UUID or 8-char ShortID (as shown by `truncateID`), or an alias.
+// 2. exactMatches — case-insensitive full name equality.
+// 3. substringMatches — preserves the existing partial-name UX.
+func matchAssignee(name string, kinds assigneeKinds, candidates []assigneeCandidate) (string, string, error) {
+ input := normalizeAssigneeLookupInput(name)
+ if input == "" {
+ return "", "", fmt.Errorf("no %s found matching %q", kinds.describe(), name)
+ }
+ inputLower := strings.ToLower(input)
+
+ var idMatches, exactMatches, substringMatches []assigneeMatch
+ for _, c := range candidates {
+ switch {
+ case c.ID != "" && (strings.EqualFold(c.ID, input) || strings.EqualFold(truncateID(c.ID), input)):
+ idMatches = append(idMatches, c.assigneeMatch)
+ case c.matchesAlias(input):
+ idMatches = append(idMatches, c.assigneeMatch)
+ case strings.EqualFold(c.Name, input):
+ exactMatches = append(exactMatches, c.assigneeMatch)
+ case strings.Contains(strings.ToLower(c.Name), inputLower):
+ substringMatches = append(substringMatches, c.assigneeMatch)
+ }
+ }
+
for _, bucket := range [][]assigneeMatch{idMatches, exactMatches, substringMatches} {
switch len(bucket) {
case 0:
diff --git a/server/cmd/multica/cmd_issue_resolve_properties_test.go b/server/cmd/multica/cmd_issue_resolve_properties_test.go
new file mode 100644
index 0000000000..93fb70d299
--- /dev/null
+++ b/server/cmd/multica/cmd_issue_resolve_properties_test.go
@@ -0,0 +1,555 @@
+package main
+
+import (
+ "encoding/json"
+ "net/http"
+ "net/http/httptest"
+ "net/url"
+ "reflect"
+ "strings"
+ "testing"
+
+ "github.com/spf13/cobra"
+)
+
+const (
+ testOwnersDefID = "b0b0b0b0-1111-4111-8111-111111111111"
+ testStaleOptionID = "99999999-9999-4999-8999-999999999999"
+ testMemberAdaID = "abababab-2222-4222-8222-222222222222"
+ testMemberGoneID = "abababab-3333-4333-8333-333333333333"
+)
+
+// resolvePropertiesTestCatalog is the filter catalog plus a multi_actor
+// definition, so both multi-value shapes are covered.
+func resolvePropertiesTestCatalog() []propertyDTO {
+ owners := propertyDTO{ID: testOwnersDefID, Name: "Owners", Type: "multi_actor"}
+ return append(propertyFilterTestCatalog(), owners)
+}
+
+// alphaBag sets one value of every type, including an archived definition
+// and a type this build does not know.
+func alphaBag() map[string]any {
+ return map[string]any{
+ testImpactDefID: testImpactHighID,
+ testBlockedDefID: true,
+ testNotesDefID: "needs a second look",
+ testArchivedDefID: testImpactLowID,
+ testPlatformsDefID: []any{testPlatformsIOSID},
+ testReviewerDefID: "member:" + testMemberAdaID,
+ testScoreDefID: float64(42),
+ testShipDateDefID: "2026-08-28",
+ testSpecDefID: "https://example.com/spec",
+ testFutureDefID: "meh",
+ testOwnersDefID: []any{"member:" + testMemberAdaID, "member:" + testMemberGoneID},
+ }
+}
+
+// alphaRows is alphaBag resolved against the catalog: catalog order, names
+// beside ids, the archived definition still resolved, the unknown type and
+// the removed member rendered raw.
+func alphaRows() []issuePropertyValueRow {
+ return []issuePropertyValueRow{
+ {PropertyID: testImpactDefID, Name: "Impact", Type: "select", Value: testImpactHighID, Display: "High"},
+ {PropertyID: testBlockedDefID, Name: "Blocked", Type: "checkbox", Value: true, Display: "✓"},
+ {PropertyID: testNotesDefID, Name: "Notes", Type: "text", Value: "needs a second look", Display: "needs a second look"},
+ {PropertyID: testArchivedDefID, Name: "Old Impact", Type: "select", Value: testImpactLowID, Display: "Legacy", Archived: true},
+ {PropertyID: testPlatformsDefID, Name: "Platforms", Type: "multi_select", Value: []any{testPlatformsIOSID}, Display: "iOS", DisplayValues: []string{"iOS"}},
+ {PropertyID: testReviewerDefID, Name: "Reviewer", Type: "actor", Value: "member:" + testMemberAdaID, Display: "Ada"},
+ {PropertyID: testScoreDefID, Name: "Score", Type: "number", Value: float64(42), Display: "42"},
+ {PropertyID: testShipDateDefID, Name: "Ship Date", Type: "date", Value: "2026-08-28", Display: "2026-08-28"},
+ {PropertyID: testSpecDefID, Name: "Spec", Type: "url", Value: "https://example.com/spec", Display: "https://example.com/spec"},
+ {PropertyID: testFutureDefID, Name: "Sentiment", Type: "mood", Value: "meh", Display: "meh"},
+ {PropertyID: testOwnersDefID, Name: "Owners", Type: "multi_actor",
+ Value: []any{"member:" + testMemberAdaID, "member:" + testMemberGoneID},
+ Display: "Ada, member:" + testMemberGoneID,
+ DisplayValues: []string{"Ada", "member:" + testMemberGoneID}},
+ }
+}
+
+func testIssue(id, key string, bag any) map[string]any {
+ issue := map[string]any{"id": id, "identifier": key, "title": key + " title", "status": "todo"}
+ if bag != nil {
+ issue["properties"] = bag
+ }
+ return issue
+}
+
+// resolveTestServer serves a fixed page, the catalog and the member list,
+// counting the catalog and member requests so tests can pin when each is
+// (not) made. Status overrides fail an endpoint.
+type resolveTestServer struct {
+ page []map[string]any
+ catalog []propertyDTO
+ catalogStatus int
+ membersStatus int
+
+ propertiesCalls int
+ membersCalls int
+ issueQueries []url.Values
+}
+
+func newResolveTestServer(t *testing.T, page ...map[string]any) *resolveTestServer {
+ t.Helper()
+ s := &resolveTestServer{page: page, catalog: resolvePropertiesTestCatalog()}
+ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ switch r.URL.Path {
+ case "/api/properties":
+ s.propertiesCalls++
+ if s.catalogStatus != 0 {
+ http.Error(w, "catalog unavailable", s.catalogStatus)
+ return
+ }
+ _ = json.NewEncoder(w).Encode(map[string]any{"properties": s.catalog})
+ case "/api/issues":
+ s.issueQueries = append(s.issueQueries, r.URL.Query())
+ _ = json.NewEncoder(w).Encode(map[string]any{"issues": s.page, "total": len(s.page)})
+ case "/api/issues/MUL-1":
+ _ = json.NewEncoder(w).Encode(map[string]any{"id": "issue-1", "identifier": "MUL-1"})
+ case "/api/issues/issue-1":
+ _ = json.NewEncoder(w).Encode(s.page[0])
+ case "/api/issues/issue-1/properties/" + testReviewerDefID:
+ var body struct {
+ Value any `json:"value"`
+ }
+ _ = json.NewDecoder(r.Body).Decode(&body)
+ _ = json.NewEncoder(w).Encode(map[string]any{"properties": map[string]any{testReviewerDefID: body.Value}})
+ case "/api/workspaces/ws-1/members":
+ s.membersCalls++
+ if s.membersStatus != 0 {
+ http.Error(w, "members unavailable", s.membersStatus)
+ return
+ }
+ _ = json.NewEncoder(w).Encode([]map[string]any{
+ {"user_id": testMemberAdaID, "name": "Ada"},
+ })
+ default:
+ http.NotFound(w, r)
+ }
+ }))
+ t.Cleanup(srv.Close)
+
+ t.Setenv("MULTICA_SERVER_URL", srv.URL)
+ t.Setenv("MULTICA_WORKSPACE_ID", "ws-1")
+ t.Setenv("MULTICA_TOKEN", "test-token")
+ return s
+}
+
+// jsonValue round-trips v through encoding/json so fixtures written with Go
+// types compare against what the CLI decoded and printed.
+func jsonValue(t *testing.T, v any) any {
+ t.Helper()
+ buf, err := json.Marshal(v)
+ if err != nil {
+ t.Fatalf("marshal: %v", err)
+ }
+ var out any
+ if err := json.Unmarshal(buf, &out); err != nil {
+ t.Fatalf("unmarshal: %v", err)
+ }
+ return out
+}
+
+func runIssueListJSON(t *testing.T, flags map[string]string) (string, map[string]any, error) {
+ t.Helper()
+ cmd := newIssueListTestCmd()
+ _ = cmd.Flags().Set("output", "json")
+ for name, value := range flags {
+ if err := cmd.Flags().Set(name, value); err != nil {
+ t.Fatalf("set --%s %q: %v", name, value, err)
+ }
+ }
+ out, err := captureStdout(t, func() error { return runIssueList(cmd, nil) })
+ if err != nil {
+ return out, nil, err
+ }
+ var resp map[string]any
+ if err := json.Unmarshal([]byte(out), &resp); err != nil {
+ t.Fatalf("unmarshal output: %v\n%s", err, out)
+ }
+ return out, resp, nil
+}
+
+func issuesOf(t *testing.T, resp map[string]any) []map[string]any {
+ t.Helper()
+ raw, _ := resp["issues"].([]any)
+ issues := make([]map[string]any, 0, len(raw))
+ for _, item := range raw {
+ issue, ok := item.(map[string]any)
+ if !ok {
+ t.Fatalf("issue entry is %T", item)
+ }
+ issues = append(issues, issue)
+ }
+ return issues
+}
+
+func TestRunIssueListResolvesProperties(t *testing.T) {
+ srv := newResolveTestServer(t,
+ testIssue("issue-1", "MUL-1", alphaBag()),
+ testIssue("issue-2", "MUL-2", map[string]any{}),
+ testIssue("issue-3", "MUL-3", map[string]any{testImpactDefID: testStaleOptionID}),
+ testIssue("issue-4", "MUL-4", nil),
+ )
+
+ _, resp, err := runIssueListJSON(t, map[string]string{"resolve-properties": "true"})
+ if err != nil {
+ t.Fatalf("runIssueList: %v", err)
+ }
+ issues := issuesOf(t, resp)
+ if len(issues) != 4 {
+ t.Fatalf("issues = %d, want 4", len(issues))
+ }
+
+ if got, want := issues[0]["properties"], jsonValue(t, alphaRows()); !reflect.DeepEqual(got, want) {
+ t.Errorf("resolved rows differ\n got: %#v\nwant: %#v", got, want)
+ }
+ // Pin the wire keys independently of the struct tags: display_values
+ // only on multi-value rows, archived only on the archived definition.
+ rows, _ := issues[0]["properties"].([]any)
+ for _, raw := range rows {
+ row, _ := raw.(map[string]any)
+ _, hasValues := row["display_values"]
+ multi := row["type"] == "multi_select" || row["type"] == "multi_actor"
+ if hasValues != multi {
+ t.Errorf("row %v: display_values present = %v, want %v", row["name"], hasValues, multi)
+ }
+ _, hasArchived := row["archived"]
+ if hasArchived != (row["property_id"] == testArchivedDefID) {
+ t.Errorf("row %v: archived present = %v", row["name"], hasArchived)
+ }
+ }
+ if got := issues[0]["title"]; got != "MUL-1 title" {
+ t.Errorf("other issue fields must survive; title = %v", got)
+ }
+
+ if got := issues[1]["properties"]; !reflect.DeepEqual(got, []any{}) {
+ t.Errorf("empty bag = %#v, want []", got)
+ }
+
+ // A stored option id that is no longer in the definition keeps its key
+ // and surfaces the raw id, the way the server sorts it as NULL rather
+ // than failing.
+ stale := []issuePropertyValueRow{{PropertyID: testImpactDefID, Name: "Impact", Type: "select", Value: testStaleOptionID, Display: testStaleOptionID}}
+ if got, want := issues[2]["properties"], jsonValue(t, stale); !reflect.DeepEqual(got, want) {
+ t.Errorf("stale option rows = %#v, want %#v", got, want)
+ }
+
+ if _, present := issues[3]["properties"]; present {
+ t.Errorf("an issue without a properties key must stay without one: %#v", issues[3]["properties"])
+ }
+
+ for _, key := range []string{"total", "limit", "offset", "has_more"} {
+ if _, ok := resp[key]; !ok {
+ t.Errorf("wrapper key %q missing from %v", key, resp)
+ }
+ }
+ if srv.propertiesCalls != 1 || srv.membersCalls != 1 {
+ t.Errorf("catalog calls = %d, members calls = %d; want one each", srv.propertiesCalls, srv.membersCalls)
+ }
+}
+
+func TestRunIssueListWithoutResolveKeepsRawBag(t *testing.T) {
+ srv := newResolveTestServer(t, testIssue("issue-1", "MUL-1", alphaBag()))
+
+ plain, resp, err := runIssueListJSON(t, nil)
+ if err != nil {
+ t.Fatalf("runIssueList: %v", err)
+ }
+ if got, want := issuesOf(t, resp)[0]["properties"], jsonValue(t, alphaBag()); !reflect.DeepEqual(got, want) {
+ t.Errorf("properties changed without the flag\n got: %#v\nwant: %#v", got, want)
+ }
+ if srv.propertiesCalls != 0 || srv.membersCalls != 0 {
+ t.Errorf("catalog calls = %d, members calls = %d; want none without the flag", srv.propertiesCalls, srv.membersCalls)
+ }
+
+ explicit, _, err := runIssueListJSON(t, map[string]string{"resolve-properties": "false"})
+ if err != nil {
+ t.Fatalf("runIssueList: %v", err)
+ }
+ if explicit != plain {
+ t.Errorf("--resolve-properties=false output differs from the default:\n%s\n---\n%s", explicit, plain)
+ }
+}
+
+func TestRunIssueListResolvePropertiesTableUnaffected(t *testing.T) {
+ srv := newResolveTestServer(t, testIssue("issue-1", "MUL-1", alphaBag()))
+ srv.catalogStatus = http.StatusInternalServerError
+
+ cmd := newIssueListTestCmd()
+ _ = cmd.Flags().Set("resolve-properties", "true")
+ if _, err := captureStdout(t, func() error { return runIssueList(cmd, nil) }); err != nil {
+ t.Fatalf("runIssueList: %v", err)
+ }
+ if srv.propertiesCalls != 0 || srv.membersCalls != 0 {
+ t.Errorf("table output must not fetch the catalog (%d) or members (%d)", srv.propertiesCalls, srv.membersCalls)
+ }
+}
+
+func TestRunIssueListResolvePropertiesCatalogError(t *testing.T) {
+ srv := newResolveTestServer(t, testIssue("issue-1", "MUL-1", alphaBag()))
+ srv.catalogStatus = http.StatusInternalServerError
+
+ _, _, err := runIssueListJSON(t, map[string]string{"resolve-properties": "true"})
+ if err == nil || !strings.Contains(err.Error(), "list properties") {
+ t.Fatalf("err = %v, want the catalog failure", err)
+ }
+}
+
+func TestRunIssueListResolvePropertiesMembersError(t *testing.T) {
+ srv := newResolveTestServer(t, testIssue("issue-1", "MUL-1", alphaBag()))
+ srv.membersStatus = http.StatusInternalServerError
+
+ // The flag promises names; a failed member lookup must not print raw
+ // references at exit 0.
+ _, _, err := runIssueListJSON(t, map[string]string{"resolve-properties": "true"})
+ if err == nil || !strings.Contains(err.Error(), "list members") {
+ t.Fatalf("err = %v, want the members failure", err)
+ }
+}
+
+func TestRunIssueListResolvePropertiesSharesCatalogFetch(t *testing.T) {
+ srv := newResolveTestServer(t, testIssue("issue-1", "MUL-1", alphaBag()))
+
+ _, resp, err := runIssueListJSON(t, map[string]string{"resolve-properties": "true", "property": "Impact=High"})
+ if err != nil {
+ t.Fatalf("runIssueList: %v", err)
+ }
+ if srv.propertiesCalls != 1 {
+ t.Errorf("catalog calls = %d, want the filter and the resolution to share one", srv.propertiesCalls)
+ }
+ if got := srv.issueQueries[0].Get("properties"); got == "" {
+ t.Errorf("filter was not sent: %v", srv.issueQueries[0])
+ }
+ if got, want := issuesOf(t, resp)[0]["properties"], jsonValue(t, alphaRows()); !reflect.DeepEqual(got, want) {
+ t.Errorf("resolved rows differ\n got: %#v\nwant: %#v", got, want)
+ }
+}
+
+func TestRunIssueListResolvePropertiesSkipsCatalogWhenNothingToResolve(t *testing.T) {
+ srv := newResolveTestServer(t,
+ testIssue("issue-2", "MUL-2", map[string]any{}),
+ testIssue("issue-4", "MUL-4", nil),
+ )
+ // A server old enough to omit properties has no catalog route either.
+ srv.catalogStatus = http.StatusNotFound
+
+ _, resp, err := runIssueListJSON(t, map[string]string{"resolve-properties": "true"})
+ if err != nil {
+ t.Fatalf("runIssueList: %v", err)
+ }
+ issues := issuesOf(t, resp)
+ if got := issues[0]["properties"]; !reflect.DeepEqual(got, []any{}) {
+ t.Errorf("empty bag = %#v, want []", got)
+ }
+ if _, present := issues[1]["properties"]; present {
+ t.Errorf("absent bag was invented: %#v", issues[1]["properties"])
+ }
+ if srv.propertiesCalls != 0 {
+ t.Errorf("catalog calls = %d, want none when no bag holds a value", srv.propertiesCalls)
+ }
+}
+
+func TestRunIssueListResolvePropertiesUnknownDefinition(t *testing.T) {
+ const orphan = "0d0d0d0d-1111-4111-8111-111111111111"
+ bag := alphaBag()
+ bag[orphan] = "stray"
+ newResolveTestServer(t, testIssue("issue-1", "MUL-1", bag))
+
+ _, _, err := runIssueListJSON(t, map[string]string{"resolve-properties": "true"})
+ if err == nil || !strings.Contains(err.Error(), "MUL-1") || !strings.Contains(err.Error(), orphan) {
+ t.Fatalf("err = %v, want the issue key and the unknown definition id", err)
+ }
+}
+
+func TestRunIssueListResolvePropertiesRejectsNonObjectBag(t *testing.T) {
+ newResolveTestServer(t, testIssue("issue-1", "MUL-1", "oops"))
+
+ _, _, err := runIssueListJSON(t, map[string]string{"resolve-properties": "true"})
+ if err == nil || !strings.Contains(err.Error(), "expected an object") {
+ t.Fatalf("err = %v, want a shape error", err)
+ }
+}
+
+func TestRunIssueListResolvePropertiesOneMembersRequestPerPage(t *testing.T) {
+ reviewer := map[string]any{testReviewerDefID: "member:" + testMemberAdaID}
+ srv := newResolveTestServer(t,
+ testIssue("issue-1", "MUL-1", reviewer),
+ testIssue("issue-2", "MUL-2", reviewer),
+ )
+ if _, _, err := runIssueListJSON(t, map[string]string{"resolve-properties": "true"}); err != nil {
+ t.Fatalf("runIssueList: %v", err)
+ }
+ if srv.membersCalls != 1 {
+ t.Errorf("members calls = %d, want one for the whole page", srv.membersCalls)
+ }
+
+ srv = newResolveTestServer(t, testIssue("issue-1", "MUL-1", map[string]any{testImpactDefID: testImpactHighID}))
+ if _, _, err := runIssueListJSON(t, map[string]string{"resolve-properties": "true"}); err != nil {
+ t.Fatalf("runIssueList: %v", err)
+ }
+ if srv.membersCalls != 0 {
+ t.Errorf("members calls = %d, want none without an actor value", srv.membersCalls)
+ }
+}
+
+// An actor --property turns a member name into an id and --resolve-properties
+// turns ids back into names. Both read the member list, and the command
+// fetches it once however many actor filters it carries.
+func TestRunIssueListActorFilterSharesMembersRequest(t *testing.T) {
+ srv := newResolveTestServer(t, testIssue("issue-1", "MUL-1", map[string]any{
+ testReviewerDefID: "member:" + testMemberAdaID,
+ testOwnersDefID: []any{"member:" + testMemberAdaID},
+ }))
+ cmd := newIssueListTestCmd()
+ _ = cmd.Flags().Set("output", "json")
+ _ = cmd.Flags().Set("resolve-properties", "true")
+ for _, flag := range []string{"Reviewer=Ada", "Owners=Ada"} {
+ _ = cmd.Flags().Set("property", flag)
+ }
+ out, err := captureStdout(t, func() error { return runIssueList(cmd, nil) })
+ if err != nil {
+ t.Fatalf("runIssueList: %v", err)
+ }
+ if srv.membersCalls != 1 {
+ t.Errorf("members calls = %d, want one shared by the filter and the resolution", srv.membersCalls)
+ }
+ want := map[string][]string{
+ testReviewerDefID: {"member:" + testMemberAdaID},
+ testOwnersDefID: {"member:" + testMemberAdaID},
+ }
+ if got := decodePropertiesParam(t, srv.issueQueries); !reflect.DeepEqual(got, want) {
+ t.Errorf("filter sent = %v, want %v", got, want)
+ }
+ var resp map[string]any
+ if err := json.Unmarshal([]byte(out), &resp); err != nil {
+ t.Fatalf("unmarshal output: %v\n%s", err, out)
+ }
+ rows := jsonValue(t, []issuePropertyValueRow{
+ {PropertyID: testReviewerDefID, Name: "Reviewer", Type: "actor", Value: "member:" + testMemberAdaID, Display: "Ada"},
+ {PropertyID: testOwnersDefID, Name: "Owners", Type: "multi_actor", Value: []any{"member:" + testMemberAdaID}, Display: "Ada", DisplayValues: []string{"Ada"}},
+ })
+ if got := issuesOf(t, resp)[0]["properties"]; !reflect.DeepEqual(got, rows) {
+ t.Errorf("resolved rows differ\n got: %#v\nwant: %#v", got, rows)
+ }
+}
+
+func newIssueGetTestCmd(output string, resolve bool) *cobra.Command {
+ cmd := &cobra.Command{Use: "get"}
+ cmd.Flags().String("output", output, "")
+ cmd.Flags().Bool("resolve-properties", resolve, "")
+ return cmd
+}
+
+func TestRunIssueGetResolvesProperties(t *testing.T) {
+ srv := newResolveTestServer(t, testIssue("issue-1", "MUL-1", alphaBag()))
+
+ out, err := captureStdout(t, func() error { return runIssueGet(newIssueGetTestCmd("json", true), []string{"MUL-1"}) })
+ if err != nil {
+ t.Fatalf("runIssueGet: %v", err)
+ }
+ var issue map[string]any
+ if err := json.Unmarshal([]byte(out), &issue); err != nil {
+ t.Fatalf("unmarshal output: %v\n%s", err, out)
+ }
+ if got, want := issue["properties"], jsonValue(t, alphaRows()); !reflect.DeepEqual(got, want) {
+ t.Errorf("resolved rows differ\n got: %#v\nwant: %#v", got, want)
+ }
+ if srv.propertiesCalls != 1 || srv.membersCalls != 1 {
+ t.Errorf("catalog calls = %d, members calls = %d; want one each", srv.propertiesCalls, srv.membersCalls)
+ }
+
+ srv = newResolveTestServer(t, testIssue("issue-1", "MUL-1", alphaBag()))
+ out, err = captureStdout(t, func() error { return runIssueGet(newIssueGetTestCmd("json", false), []string{"MUL-1"}) })
+ if err != nil {
+ t.Fatalf("runIssueGet: %v", err)
+ }
+ if err := json.Unmarshal([]byte(out), &issue); err != nil {
+ t.Fatalf("unmarshal output: %v\n%s", err, out)
+ }
+ if got, want := issue["properties"], jsonValue(t, alphaBag()); !reflect.DeepEqual(got, want) {
+ t.Errorf("properties changed without the flag\n got: %#v\nwant: %#v", got, want)
+ }
+ if srv.propertiesCalls != 0 {
+ t.Errorf("catalog calls = %d, want none without the flag", srv.propertiesCalls)
+ }
+
+ srv = newResolveTestServer(t, testIssue("issue-1", "MUL-1", alphaBag()))
+ srv.catalogStatus = http.StatusInternalServerError
+ if _, err := captureStdout(t, func() error { return runIssueGet(newIssueGetTestCmd("table", true), []string{"MUL-1"}) }); err != nil {
+ t.Fatalf("runIssueGet table: %v", err)
+ }
+ if srv.propertiesCalls != 0 {
+ t.Errorf("table output must not fetch the catalog (%d)", srv.propertiesCalls)
+ }
+}
+
+// --fields and --resolve-properties both rewrite the same properties key.
+// Keeping properties resolves it exactly as without --fields; dropping it is
+// rejected up front rather than silently ignoring the flag or paying for a
+// catalog and member request whose output is deleted a line later.
+func TestRunIssueListResolvePropertiesWithFields(t *testing.T) {
+ srv := newResolveTestServer(t, testIssue("issue-1", "MUL-1", alphaBag()))
+
+ _, resp, err := runIssueListJSON(t, map[string]string{
+ "fields": "id,title,properties",
+ "resolve-properties": "true",
+ })
+ if err != nil {
+ t.Fatalf("runIssueList: %v", err)
+ }
+ issue := issuesOf(t, resp)[0]
+ if got, want := issue["properties"], jsonValue(t, alphaRows()); !reflect.DeepEqual(got, want) {
+ t.Errorf("resolved rows differ under --fields\n got: %#v\nwant: %#v", got, want)
+ }
+ if _, present := issue["status"]; present {
+ t.Errorf("--fields did not drop status: %v", issue)
+ }
+ if srv.propertiesCalls != 1 || srv.membersCalls != 1 {
+ t.Errorf("catalog calls = %d, members calls = %d; want one each", srv.propertiesCalls, srv.membersCalls)
+ }
+
+ // properties filtered out: refuse rather than resolve into the void.
+ srv = newResolveTestServer(t, testIssue("issue-1", "MUL-1", alphaBag()))
+ _, _, err = runIssueListJSON(t, map[string]string{
+ "fields": "id,title",
+ "resolve-properties": "true",
+ })
+ if err == nil || !strings.Contains(err.Error(), "--resolve-properties needs the properties field") {
+ t.Fatalf("err = %v, want the --fields/--resolve-properties conflict", err)
+ }
+ if srv.propertiesCalls != 0 || srv.membersCalls != 0 {
+ t.Errorf("rejected combination still fetched: catalog %d, members %d", srv.propertiesCalls, srv.membersCalls)
+ }
+
+ // Table output ignores both flags, so the guard must not fire there: a
+ // reader who keeps them on the command line and switches back to a table
+ // still gets the table (found in final review of the guard commit).
+ srv = newResolveTestServer(t, testIssue("issue-1", "MUL-1", alphaBag()))
+ tableCmd := newIssueListTestCmd()
+ _ = tableCmd.Flags().Set("output", "table")
+ _ = tableCmd.Flags().Set("fields", "id,title")
+ _ = tableCmd.Flags().Set("resolve-properties", "true")
+ out, err := captureStdout(t, func() error { return runIssueList(tableCmd, nil) })
+ if err != nil {
+ t.Fatalf("table output must ignore both flags, got: %v", err)
+ }
+ if !strings.Contains(out, "MUL-1") {
+ t.Errorf("table output lost its row:\n%s", out)
+ }
+ if srv.propertiesCalls != 0 || srv.membersCalls != 0 {
+ t.Errorf("table output fetched: catalog %d, members %d", srv.propertiesCalls, srv.membersCalls)
+ }
+
+ // --fields alone keeps the raw bag; the guard must not fire without the flag.
+ srv = newResolveTestServer(t, testIssue("issue-1", "MUL-1", alphaBag()))
+ _, resp, err = runIssueListJSON(t, map[string]string{"fields": "id,title"})
+ if err != nil {
+ t.Fatalf("runIssueList without --resolve-properties: %v", err)
+ }
+ if _, present := issuesOf(t, resp)[0]["properties"]; present {
+ t.Errorf("--fields id,title kept properties")
+ }
+ if srv.propertiesCalls != 0 || srv.membersCalls != 0 {
+ t.Errorf("plain --fields fetched: catalog %d, members %d", srv.propertiesCalls, srv.membersCalls)
+ }
+}
diff --git a/server/cmd/multica/cmd_issue_test.go b/server/cmd/multica/cmd_issue_test.go
index cfe7c72c8a..6cee266f9d 100644
--- a/server/cmd/multica/cmd_issue_test.go
+++ b/server/cmd/multica/cmd_issue_test.go
@@ -1256,7 +1256,7 @@ func TestResolveAssignee(t *testing.T) {
})
t.Run("resolveActorPropertyRef renders a prefixed reference", func(t *testing.T) {
- ref, err := resolveActorPropertyRef(ctx, client, "[email protected]")
+ ref, err := resolveActorPropertyRef(ctx, client, &memberDirectory{}, "[email protected]")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
@@ -1266,7 +1266,7 @@ func TestResolveAssignee(t *testing.T) {
})
t.Run("resolveActorPropertyRef rejects a non-member kind", func(t *testing.T) {
- if _, err := resolveActorPropertyRef(ctx, client, "codebot"); err == nil {
+ if _, err := resolveActorPropertyRef(ctx, client, &memberDirectory{}, "codebot"); err == nil {
t.Error("expected an agent name to be unresolvable for an actor property")
}
})
@@ -2930,6 +2930,7 @@ func newIssueListTestCmd() *cobra.Command {
cmd.Flags().String("sort", "", "")
cmd.Flags().String("direction", "", "")
cmd.Flags().String("fields", "", "")
+ cmd.Flags().Bool("resolve-properties", false, "")
return cmd
}
diff --git a/server/cmd/multica/cmd_property.go b/server/cmd/multica/cmd_property.go
index e33d11107e..53a48e036f 100644
--- a/server/cmd/multica/cmd_property.go
+++ b/server/cmd/multica/cmd_property.go
@@ -7,6 +7,7 @@ import (
"math"
"net/url"
"os"
+ "sort"
"strconv"
"strings"
"time"
@@ -444,11 +445,34 @@ func makePropertyArchiveRun(archive bool) func(*cobra.Command, []string) error {
// issue property {list|set|unset}
// ---------------------------------------------------------------------------
+// memberDirectory serves every member lookup in one command from a single
+// request. An actor --property filter, an actor --value and
+// --resolve-properties all read the list, and each used to fetch its own.
+type memberDirectory struct {
+ members []map[string]any
+ loaded bool
+}
+
+func (d *memberDirectory) load(ctx context.Context, client *cli.APIClient) ([]map[string]any, error) {
+ if d.loaded {
+ return d.members, nil
+ }
+ if client.WorkspaceID == "" {
+ return nil, fmt.Errorf("workspace ID is required to resolve members; use --workspace-id or set MULTICA_WORKSPACE_ID")
+ }
+ var members []map[string]any
+ if err := getAssigneeJSON(ctx, client, "/api/workspaces/"+client.WorkspaceID+"/members", &members); err != nil {
+ return nil, fmt.Errorf("list members: %w", err)
+ }
+ d.members, d.loaded = members, true
+ return members, nil
+}
+
// resolveActorPropertyRef turns one --value token into a "member:<uuid>"
// actor reference. An already-prefixed token is taken as-is (after checking
-// the id parses); anything else goes through the same member lookup
-// `--assignee` uses, so names, emails, UUIDs and short ids all work.
-func resolveActorPropertyRef(ctx context.Context, client *cli.APIClient, raw string) (string, error) {
+// the id parses); anything else is matched the way `--assignee` matches
+// members, so names, emails, UUIDs and short ids all work.
+func resolveActorPropertyRef(ctx context.Context, client *cli.APIClient, directory *memberDirectory, raw string) (string, error) {
token := strings.TrimSpace(raw)
if token == "" {
return "", fmt.Errorf("actor value cannot be empty")
@@ -464,7 +488,11 @@ func resolveActorPropertyRef(ctx context.Context, client *cli.APIClient, raw str
// store fine via `property set` but silently miss as a filter.
return kind + ":" + parsed.String(), nil
}
- actorType, actorID, err := resolveAssignee(ctx, client, token, memberOnlyKinds)
+ members, err := directory.load(ctx, client)
+ if err != nil {
+ return "", fmt.Errorf("failed to resolve assignee: %w", err)
+ }
+ actorType, actorID, err := matchAssignee(token, memberOnlyKinds, memberCandidates(members))
if err != nil {
return "", err
}
@@ -491,7 +519,7 @@ func resolveSelectOptionRef(property propertyDTO, ref string) (string, error) {
// encodeIssuePropertyValue converts the CLI --value string into the typed
// JSON the API expects, translating option names to ids for select types and
// member names to actor references for actor types.
-func encodeIssuePropertyValue(ctx context.Context, client *cli.APIClient, property propertyDTO, raw string) (json.RawMessage, error) {
+func encodeIssuePropertyValue(ctx context.Context, client *cli.APIClient, directory *memberDirectory, property propertyDTO, raw string) (json.RawMessage, error) {
optionNames := make([]string, len(property.Config.Options))
for i, opt := range property.Config.Options {
optionNames[i] = opt.Name
@@ -522,7 +550,7 @@ func encodeIssuePropertyValue(ctx context.Context, client *cli.APIClient, proper
}
return json.Marshal(ids)
case "actor":
- ref, err := resolveActorPropertyRef(ctx, client, raw)
+ ref, err := resolveActorPropertyRef(ctx, client, directory, raw)
if err != nil {
return nil, err
}
@@ -534,7 +562,7 @@ func encodeIssuePropertyValue(ctx context.Context, client *cli.APIClient, proper
if strings.TrimSpace(part) == "" {
continue
}
- ref, err := resolveActorPropertyRef(ctx, client, part)
+ ref, err := resolveActorPropertyRef(ctx, client, directory, part)
if err != nil {
return nil, err
}
@@ -559,53 +587,68 @@ func encodeIssuePropertyValue(ctx context.Context, client *cli.APIClient, proper
}
}
+// propertyOptionName maps a stored option id to its name, or returns the id
+// when the option is no longer in the definition (the server sorts such a
+// value as NULL rather than failing; display does the same).
+func propertyOptionName(property propertyDTO, id string) string {
+ for _, opt := range property.Config.Options {
+ if opt.ID == id {
+ return opt.Name
+ }
+ }
+ return id
+}
+
+func actorPropertyName(actorNames map[string]string, ref string) string {
+ if name, ok := actorNames[ref]; ok {
+ return name
+ }
+ return ref
+}
+
+// issuePropertyDisplayValues resolves each item of a multi_select or
+// multi_actor value to its display name. The result stays index-parallel
+// with the stored array (a non-string item renders as JSON rather than being
+// dropped) and is nil for every other type or a non-array value.
+func issuePropertyDisplayValues(property propertyDTO, value any, actorNames map[string]string) []string {
+ if property.Type != "multi_select" && property.Type != "multi_actor" {
+ return nil
+ }
+ items, ok := value.([]any)
+ if !ok {
+ return nil
+ }
+ names := make([]string, 0, len(items))
+ for _, item := range items {
+ s, ok := item.(string)
+ switch {
+ case !ok:
+ names = append(names, formatMetadataValue(item))
+ case property.Type == "multi_select":
+ names = append(names, propertyOptionName(property, s))
+ default:
+ names = append(names, actorPropertyName(actorNames, s))
+ }
+ }
+ return names
+}
+
// formatIssuePropertyValue renders a stored value for humans: option ids
// become option names, actor references become member names, everything
// else prints via formatMetadataValue. actorNames may be nil — references then
// print in their raw "<kind>:<uuid>" form rather than failing.
func formatIssuePropertyValue(property propertyDTO, value any, actorNames map[string]string) string {
- optionName := func(id string) string {
- for _, opt := range property.Config.Options {
- if opt.ID == id {
- return opt.Name
- }
- }
- return id
- }
- actorName := func(ref string) string {
- if name, ok := actorNames[ref]; ok {
- return name
- }
- return ref
+ if names := issuePropertyDisplayValues(property, value, actorNames); names != nil {
+ return strings.Join(names, ", ")
}
switch property.Type {
case "select":
if s, ok := value.(string); ok {
- return optionName(s)
- }
- case "multi_select":
- if items, ok := value.([]any); ok {
- names := make([]string, 0, len(items))
- for _, item := range items {
- if s, ok := item.(string); ok {
- names = append(names, optionName(s))
- }
- }
- return strings.Join(names, ", ")
+ return propertyOptionName(property, s)
}
case "actor":
if s, ok := value.(string); ok {
- return actorName(s)
- }
- case "multi_actor":
- if items, ok := value.([]any); ok {
- names := make([]string, 0, len(items))
- for _, item := range items {
- if s, ok := item.(string); ok {
- names = append(names, actorName(s))
- }
- }
- return strings.Join(names, ", ")
+ return actorPropertyName(actorNames, s)
}
case "checkbox":
if b, ok := value.(bool); ok {
@@ -618,13 +661,18 @@ func formatIssuePropertyValue(property propertyDTO, value any, actorNames map[st
return formatMetadataValue(value)
}
+// issuePropertyValueRow is one set property on an issue. display is the
+// human rendering; display_values carries the per-item names of a
+// multi_select or multi_actor value, since a joined string is ambiguous
+// once an option name contains a comma.
type issuePropertyValueRow struct {
- PropertyID string `json:"property_id"`
- Name string `json:"name"`
- Type string `json:"type"`
- Value any `json:"value"`
- Display string `json:"display"`
- Archived bool `json:"archived,omitempty"`
+ PropertyID string `json:"property_id"`
+ Name string `json:"name"`
+ Type string `json:"type"`
+ Value any `json:"value"`
+ Display string `json:"display"`
+ DisplayValues []string `json:"display_values,omitempty"`
+ Archived bool `json:"archived,omitempty"`
}
func buildIssuePropertyRows(properties []propertyDTO, bag map[string]any, actorNames map[string]string) []issuePropertyValueRow {
@@ -635,42 +683,111 @@ func buildIssuePropertyRows(properties []propertyDTO, bag map[string]any, actorN
continue
}
rows = append(rows, issuePropertyValueRow{
- PropertyID: p.ID,
- Name: p.Name,
- Type: p.Type,
- Value: value,
- Display: formatIssuePropertyValue(p, value, actorNames),
- Archived: p.Archived,
+ PropertyID: p.ID,
+ Name: p.Name,
+ Type: p.Type,
+ Value: value,
+ Display: formatIssuePropertyValue(p, value, actorNames),
+ DisplayValues: issuePropertyDisplayValues(p, value, actorNames),
+ Archived: p.Archived,
})
}
return rows
}
// fetchActorPropertyNames builds a "member:<uuid>" → display name map, but
-// only when the bag actually holds an actor value: every other property type
+// only when some bag actually holds an actor value: every other property type
// renders without a second round trip, and `issue property list` shouldn't pay
// for a request it doesn't need.
-func fetchActorPropertyNames(ctx context.Context, client *cli.APIClient, properties []propertyDTO, bag map[string]any) map[string]string {
+func fetchActorPropertyNames(ctx context.Context, client *cli.APIClient, directory *memberDirectory, properties []propertyDTO, bags ...map[string]any) (map[string]string, error) {
needed := false
for _, p := range properties {
- if _, present := bag[p.ID]; present && (p.Type == "actor" || p.Type == "multi_actor") {
- needed = true
- break
+ if p.Type != "actor" && p.Type != "multi_actor" {
+ continue
+ }
+ for _, bag := range bags {
+ if _, present := bag[p.ID]; present {
+ needed = true
+ }
}
}
if !needed || client.WorkspaceID == "" {
- return nil
+ return nil, nil
}
- names := make(map[string]string)
- var members []map[string]any
- if err := getAssigneeJSON(ctx, client, "/api/workspaces/"+client.WorkspaceID+"/members", &members); err == nil {
- for _, m := range members {
- if id := strVal(m, "user_id"); id != "" {
- names["member:"+id] = strVal(m, "name")
+ members, err := directory.load(ctx, client)
+ if err != nil {
+ return nil, err
+ }
+ names := make(map[string]string, len(members))
+ for _, m := range members {
+ if id := strVal(m, "user_id"); id != "" {
+ names["member:"+id] = strVal(m, "name")
+ }
+ }
+ return names, nil
+}
+
+const resolvePropertiesHelp = "JSON output only: replace the properties id map with the rows `issue property list` prints (property name and type, option and member names beside the stored ids). Omit for the raw map. No effect on --output table."
+
+// resolveIssueProperties rewrites each issue's properties bag in place into
+// the rows issue property list prints. A nil catalog is fetched on demand,
+// after the page and only when some bag holds a value, so a server without
+// the endpoint still serves pages with nothing to resolve. A bag key with no
+// definition is an error rather than a dropped value: --property and --sort
+// fetch the catalog before the page, so a definition can be newer than it.
+func resolveIssueProperties(ctx context.Context, client *cli.APIClient, catalog []propertyDTO, directory *memberDirectory, issues []any) error {
+ type target struct {
+ issue map[string]any
+ bag map[string]any
+ }
+ var targets []target
+ var bags []map[string]any
+ for _, raw := range issues {
+ issue, ok := raw.(map[string]any)
+ if !ok {
+ return fmt.Errorf("resolve properties: issue is %T, expected an object", raw)
+ }
+ value, present := issue["properties"]
+ if !present {
+ continue
+ }
+ bag, ok := value.(map[string]any)
+ if !ok {
+ return fmt.Errorf("resolve properties: %s: properties is %T, expected an object", issueDisplayKey(issue), value)
+ }
+ targets = append(targets, target{issue: issue, bag: bag})
+ if len(bag) > 0 {
+ bags = append(bags, bag)
+ }
+ }
+ if len(bags) > 0 && catalog == nil {
+ var err error
+ if catalog, err = fetchProperties(ctx, client); err != nil {
+ return err
+ }
+ }
+ actorNames, err := fetchActorPropertyNames(ctx, client, directory, catalog, bags...)
+ if err != nil {
+ return err
+ }
+ known := make(map[string]bool, len(catalog))
+ for _, p := range catalog {
+ known[p.ID] = true
+ }
+ for _, t := range targets {
+ var unknown []string
+ for id := range t.bag {
+ if !known[id] {
+ unknown = append(unknown, id)
}
}
+ if len(unknown) > 0 {
+ sort.Strings(unknown)
+ return fmt.Errorf("resolve properties: %s has values for property definitions missing from the catalog (%s); re-run to fetch a current catalog", issueDisplayKey(t.issue), strings.Join(unknown, ", "))
+ }
+ t.issue["properties"] = buildIssuePropertyRows(catalog, t.bag, actorNames)
}
- return names
+ return nil
}
func fetchIssuePropertyBag(ctx context.Context, client *cli.APIClient, issueID string) (map[string]any, error) {
@@ -715,7 +832,9 @@ func runIssuePropertyList(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
- rows := buildIssuePropertyRows(properties, bag, fetchActorPropertyNames(ctx, client, properties, bag))
+ // A failed member lookup leaves display on the raw reference.
+ actorNames, _ := fetchActorPropertyNames(ctx, client, &memberDirectory{}, properties, bag)
+ rows := buildIssuePropertyRows(properties, bag, actorNames)
output, _ := cmd.Flags().GetString("output")
if output == "json" {
return cli.PrintJSON(os.Stdout, rows)
@@ -753,7 +872,8 @@ func runIssuePropertySet(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
- value, err := encodeIssuePropertyValue(ctx, client, property, rawValue)
+ var members memberDirectory
+ value, err := encodeIssuePropertyValue(ctx, client, &members, property, rawValue)
if err != nil {
return err
}
@@ -765,7 +885,9 @@ func runIssuePropertySet(cmd *cobra.Command, args []string) error {
if err := client.PutJSON(ctx, path, map[string]any{"value": value}, &result); err != nil {
return fmt.Errorf("set property: %w", err)
}
- rows := buildIssuePropertyRows(properties, result.Properties, fetchActorPropertyNames(ctx, client, properties, result.Properties))
+ // The value is already written; a failed member lookup must not fail the command.
+ actorNames, _ := fetchActorPropertyNames(ctx, client, &members, properties, result.Properties)
+ rows := buildIssuePropertyRows(properties, result.Properties, actorNames)
output, _ := cmd.Flags().GetString("output")
if output == "json" {
return cli.PrintJSON(os.Stdout, rows)
@@ -843,7 +965,7 @@ var issueSortablePropertyTypes = []string{"select", "number", "date", "text", "u
// property ORs its values (server semantics: OR within a definition, AND
// across definitions), keyed by the RESOLVED definition id so name and UUID
// addressing aggregate into one entry.
-func buildPropertiesFilterQueryParam(ctx context.Context, client *cli.APIClient, properties []propertyDTO, pairs []string) (string, error) {
+func buildPropertiesFilterQueryParam(ctx context.Context, client *cli.APIClient, directory *memberDirectory, properties []propertyDTO, pairs []string) (string, error) {
filter := make(map[string][]string, len(pairs))
for _, pair := range pairs {
name, rawValue, found := strings.Cut(pair, "=")
@@ -865,7 +987,7 @@ func buildPropertiesFilterQueryParam(ctx context.Context, client *cli.APIClient,
if property.Archived {
return "", fmt.Errorf("property %q is archived; archived properties are hidden from filtering (matching the web UI) — restore it with `multica property unarchive` if you need it", property.Name)
}
- value, err := resolvePropertyFilterValue(ctx, client, property, rawValue)
+ value, err := resolvePropertyFilterValue(ctx, client, directory, property, rawValue)
if err != nil {
return "", err
}
@@ -898,7 +1020,7 @@ func buildPropertiesFilterQueryParam(ctx context.Context, client *cli.APIClient,
// and url length; the branches below follow it. A value that could never
// match is rejected here rather than sent, because an empty result reads
// like a real answer.
-func resolvePropertyFilterValue(ctx context.Context, client *cli.APIClient, property propertyDTO, raw string) (string, error) {
+func resolvePropertyFilterValue(ctx context.Context, client *cli.APIClient, directory *memberDirectory, property propertyDTO, raw string) (string, error) {
trimmed := strings.TrimSpace(raw)
if trimmed == propertyNoValueSentinel {
return propertyNoValueSentinel, nil
@@ -912,7 +1034,7 @@ func resolvePropertyFilterValue(ctx context.Context, client *cli.APIClient, prop
}
return trimmed, nil
case "actor", "multi_actor":
- return resolveActorPropertyRef(ctx, client, trimmed)
+ return resolveActorPropertyRef(ctx, client, directory, trimmed)
case "number":
num, err := strconv.ParseFloat(trimmed, 64)
if err != nil {
diff --git a/server/cmd/multica/cmd_property_test.go b/server/cmd/multica/cmd_property_test.go
new file mode 100644
index 0000000000..d88a75e308
--- /dev/null
+++ b/server/cmd/multica/cmd_property_test.go
@@ -0,0 +1,97 @@
+package main
+
+import (
+ "encoding/json"
+ "reflect"
+ "testing"
+
+ "github.com/spf13/cobra"
+)
+
+// A joined display string cannot be split back into option names once an
+// option name contains a comma, so multi-value rows also carry the names as
+// an array that stays index-parallel with the stored ids.
+func TestBuildIssuePropertyRowsMultiValueDisplays(t *testing.T) {
+ platforms := propertyDTO{ID: testPlatformsDefID, Name: "Platforms", Type: "multi_select"}
+ platforms.Config.Options = []propertyOptionDTO{
+ {ID: testPlatformsIOSID, Name: "iOS"},
+ {ID: "ffffffff-3333-4333-8333-333333333333", Name: "Android, tablets"},
+ }
+ impact := propertyDTO{ID: testImpactDefID, Name: "Impact", Type: "select"}
+ impact.Config.Options = []propertyOptionDTO{{ID: testImpactHighID, Name: "High"}}
+ owners := propertyDTO{ID: testReviewerDefID, Name: "Owners", Type: "multi_actor"}
+ catalog := []propertyDTO{impact, platforms, owners}
+
+ bag := map[string]any{
+ testImpactDefID: testImpactHighID,
+ testPlatformsDefID: []any{testPlatformsIOSID, "ffffffff-3333-4333-8333-333333333333", float64(7)},
+ testReviewerDefID: []any{"member:abababab-2222-4222-8222-222222222222", "member:abababab-3333-4333-8333-333333333333"},
+ }
+ actorNames := map[string]string{"member:abababab-2222-4222-8222-222222222222": "Ada"}
+
+ rows := buildIssuePropertyRows(catalog, bag, actorNames)
+ if len(rows) != 3 {
+ t.Fatalf("rows = %d, want 3: %+v", len(rows), rows)
+ }
+
+ if rows[0].DisplayValues != nil {
+ t.Errorf("select row carries display_values %v; only multi-value types should", rows[0].DisplayValues)
+ }
+ if rows[0].Display != "High" {
+ t.Errorf("select display = %q, want High", rows[0].Display)
+ }
+
+ // The stray number keeps its slot so display_values lines up with value.
+ wantPlatforms := []string{"iOS", "Android, tablets", "7"}
+ if !reflect.DeepEqual(rows[1].DisplayValues, wantPlatforms) {
+ t.Errorf("multi_select display_values = %v, want %v", rows[1].DisplayValues, wantPlatforms)
+ }
+ if rows[1].Display != "iOS, Android, tablets, 7" {
+ t.Errorf("multi_select display = %q", rows[1].Display)
+ }
+
+ // An unknown member keeps its raw reference rather than an empty name.
+ wantOwners := []string{"Ada", "member:abababab-3333-4333-8333-333333333333"}
+ if !reflect.DeepEqual(rows[2].DisplayValues, wantOwners) {
+ t.Errorf("multi_actor display_values = %v, want %v", rows[2].DisplayValues, wantOwners)
+ }
+}
+
+func TestFormatIssuePropertyValueMultiValueNotArray(t *testing.T) {
+ platforms := propertyDTO{ID: testPlatformsDefID, Name: "Platforms", Type: "multi_select"}
+ // A value that is not an array falls through to the raw rendering and
+ // yields no display_values, the same as before the array existed.
+ if got := formatIssuePropertyValue(platforms, "not-a-list", nil); got != "not-a-list" {
+ t.Errorf("display = %q, want the raw value", got)
+ }
+ if got := issuePropertyDisplayValues(platforms, "not-a-list", nil); got != nil {
+ t.Errorf("display_values = %v, want nil", got)
+ }
+}
+
+// An actor --value becomes an id through the member list, and the rows
+// printed afterwards turn that id back into a name; one command, one request.
+func TestRunIssuePropertySetSharesMembersRequest(t *testing.T) {
+ srv := newResolveTestServer(t, testIssue("issue-1", "MUL-1", nil))
+ cmd := &cobra.Command{Use: "set"}
+ cmd.Flags().String("name", "", "")
+ cmd.Flags().String("value", "", "")
+ cmd.Flags().String("output", "json", "")
+ _ = cmd.Flags().Set("name", "Reviewer")
+ _ = cmd.Flags().Set("value", "Ada")
+ out, err := captureStdout(t, func() error { return runIssuePropertySet(cmd, []string{"MUL-1"}) })
+ if err != nil {
+ t.Fatalf("runIssuePropertySet: %v", err)
+ }
+ if srv.membersCalls != 1 {
+ t.Errorf("members calls = %d, want one shared by the value and the printed rows", srv.membersCalls)
+ }
+ var rows []issuePropertyValueRow
+ if err := json.Unmarshal([]byte(out), &rows); err != nil {
+ t.Fatalf("unmarshal output: %v\n%s", err, out)
+ }
+ want := []issuePropertyValueRow{{PropertyID: testReviewerDefID, Name: "Reviewer", Type: "actor", Value: "member:" + testMemberAdaID, Display: "Ada"}}
+ if !reflect.DeepEqual(rows, want) {
+ t.Errorf("rows = %#v, want %#v", rows, want)
+ }
+}
diff --git a/server/internal/service/builtin_skills/multica-platform/references/issues.md b/server/internal/service/builtin_skills/multica-platform/references/issues.md
index 14e01de429..5f7a103792 100644
--- a/server/internal/service/builtin_skills/multica-platform/references/issues.md
+++ b/server/internal/service/builtin_skills/multica-platform/references/issues.md
@@ -175,6 +175,19 @@ multica issue list --sort property:Impact --direction desc --output json
text/url by value; issues without the property sort last either way.
Archived properties and types without an order (multi_select, checkbox,
actor kinds) are rejected up front.
+- `issue list` and `issue get` return `properties` as a map of definition id
+ to stored value. Add `--resolve-properties` in JSON mode to get the rows
+ `issue property list` prints instead (name, type, stored value, display
+ names); the CLI makes at most one catalog request for the whole page, so
+ no `property list` call is needed:
+
+```bash
+multica issue list --status in_progress --output json --resolve-properties
+multica issue get <issue-id> --resolve-properties
+```
+
+ Read `display` for a single value and `display_values` for a multi_select
+ or multi_actor value; `value` keeps the stored ids.
## Status changes have server side effects
diff --git a/server/internal/service/builtin_skills_test.go b/server/internal/service/builtin_skills_test.go
index 87d223b558..1205c51ee2 100644
--- a/server/internal/service/builtin_skills_test.go
+++ b/server/internal/service/builtin_skills_test.go
@@ -490,6 +490,12 @@ func TestPlatformSkillCoversPlatformContracts(t *testing.T) {
"multica issue runs <issue-id> --siblings --output json",
"capped at 20",
"Nothing here reserves an issue or serialises anything",
+ // #8008: the read path for typed properties. The flag, the
+ // per-item names and the promise that the stored ids stay
+ // beside them are each what a script joins on.
+ "--resolve-properties",
+ "display_values",
+ "`value` keeps the stored ids",
},
notWant: []string{
// MUL-6966 phase 1: this reference must not teach the KV bag