Assign readable ticket keys from project code and sequence.
Replace UUID-looking sync labels in TUI and web with keys like TAS-1, while keeping the remote UUID for task-master matching. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -68,9 +68,22 @@ type Ticket struct {
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
|
||||
// Readable key assigned by the server (e.g. "ABC-42"). Optional on local-only tickets.
|
||||
Number int `json:"number,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// External sync (optional). Local UUID stays in ID.
|
||||
Source string `json:"source,omitempty"`
|
||||
ExternalID string `json:"externalId,omitempty"`
|
||||
ExternalURL string `json:"externalUrl,omitempty"`
|
||||
SyncedAt time.Time `json:"syncedAt,omitempty"`
|
||||
}
|
||||
|
||||
// DisplayID returns the human-readable ticket label for UI.
|
||||
// Prefers the server key; falls back to ExternalID (e.g. YouTrack idReadable).
|
||||
func (t Ticket) DisplayID() string {
|
||||
if t.Key != "" {
|
||||
return t.Key
|
||||
}
|
||||
return t.ExternalID
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user