GetObjectiveLabels returns the subset of issue labels that have objective values. Also returns the labels in the order they appear in the issue's label list.
(issueLabels []string)
| 191 | // GetObjectiveLabels returns the subset of issue labels that have objective values. |
| 192 | // Also returns the labels in the order they appear in the issue's label list. |
| 193 | func (om *ObjectiveMapping) GetObjectiveLabels(issueLabels []string) []string { |
| 194 | if om == nil || len(om.LabelToValue) == 0 { |
| 195 | return []string{} |
| 196 | } |
| 197 | |
| 198 | result := make([]string, 0) |
| 199 | for _, label := range issueLabels { |
| 200 | normalizedLabel := strings.ToLower(strings.TrimSpace(label)) |
| 201 | if _, ok := om.LabelToValue[normalizedLabel]; ok { |
| 202 | result = append(result, label) |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | return result |
| 207 | } |
| 208 | |
| 209 | // MarshalJSON implements json.Marshaler to ensure consistent output. |
| 210 | func (om *ObjectiveMapping) MarshalJSON() ([]byte, error) { |