Skip to content

Commit

Permalink
Add stronger typing for hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
estephinson committed Jan 18, 2024
1 parent fbf78c6 commit 884cdef
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,24 @@ type IssueRenderedFields struct {
// IssueType represents a type of a Jira issue.
// Typical types are "Request", "Bug", "Story", ...
type IssueType struct {
Self string `json:"self,omitempty" structs:"self,omitempty"`
ID string `json:"id,omitempty" structs:"id,omitempty"`
Description string `json:"description,omitempty" structs:"description,omitempty"`
IconURL string `json:"iconUrl,omitempty" structs:"iconUrl,omitempty"`
Name string `json:"name,omitempty" structs:"name,omitempty"`
Subtask bool `json:"subtask,omitempty" structs:"subtask,omitempty"`
AvatarID int `json:"avatarId,omitempty" structs:"avatarId,omitempty"`
HierarchyLevel *int `json:"hierarchyLevel,omitempty" structs:"hierarchyLevel,omitempty"`
Self string `json:"self,omitempty" structs:"self,omitempty"`
ID string `json:"id,omitempty" structs:"id,omitempty"`
Description string `json:"description,omitempty" structs:"description,omitempty"`
IconURL string `json:"iconUrl,omitempty" structs:"iconUrl,omitempty"`
Name string `json:"name,omitempty" structs:"name,omitempty"`
Subtask bool `json:"subtask,omitempty" structs:"subtask,omitempty"`
AvatarID int `json:"avatarId,omitempty" structs:"avatarId,omitempty"`
HierarchyLevel *IssueTypeHierarchyLevel `json:"hierarchyLevel,omitempty" structs:"hierarchyLevel,omitempty"`
}

type IssueTypeHierarchyLevel = int

const (
IssueTypeHierarchyLevelEpic IssueTypeHierarchyLevel = 1
IssueTypeHierarchyLevelTask IssueTypeHierarchyLevel = 0
IssueTypeHierarchyLevelSubTask IssueTypeHierarchyLevel = -1
)

// Watches represents a type of how many and which user are "observing" a Jira issue to track the status / updates.
type Watches struct {
Self string `json:"self,omitempty" structs:"self,omitempty"`
Expand Down

0 comments on commit 884cdef

Please sign in to comment.