Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/nullify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ integrations:
disabled: true
project_key: SCRUM
issue_type: Task
severity_threshold: high
severity_threshold: HIGH
priority_threshold: IMPORTANT
on_fix_transition: Done
priorities:
critical: highest
Expand Down
3 changes: 3 additions & 0 deletions pkg/merger/merger.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ func MergeConfigFiles(
if extraConfig.Integrations.Jira.SeverityThreshold != "" {
config.Integrations.Jira.SeverityThreshold = extraConfig.Integrations.Jira.SeverityThreshold
}
if extraConfig.Integrations.Jira.PriorityThreshold != "" {
config.Integrations.Jira.PriorityThreshold = extraConfig.Integrations.Jira.PriorityThreshold
}

if extraConfig.Integrations.Jira.Priorities != nil {
config.Integrations.Jira.Priorities = extraConfig.Integrations.Jira.Priorities
Expand Down
4 changes: 4 additions & 0 deletions pkg/merger/merger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func TestMergeConfigFiles(t *testing.T) {
IssueType: "Nul-Finding",
OnFixTransition: "Done",
SeverityThreshold: models.SeverityHigh,
PriorityThreshold: models.PriorityImportant,
},
},
},
Expand Down Expand Up @@ -137,6 +138,7 @@ func TestMergeConfigFiles(t *testing.T) {
IssueType: "Nul-Finding",
OnFixTransition: "Done",
SeverityThreshold: models.SeverityHigh,
PriorityThreshold: models.PriorityImportant,
},
},
},
Expand Down Expand Up @@ -194,6 +196,7 @@ func TestMergeConfigFiles(t *testing.T) {
IssueType: "Nul-Finding",
OnFixTransition: "Done",
SeverityThreshold: models.SeverityHigh,
PriorityThreshold: models.PriorityImportant,
Priorities: &models.Priorities{
Critical: "highest",
High: "high",
Expand Down Expand Up @@ -258,6 +261,7 @@ func TestMergeConfigFiles(t *testing.T) {
IssueType: "Nul-Finding",
OnFixTransition: "Done",
SeverityThreshold: models.SeverityHigh,
PriorityThreshold: models.PriorityImportant,
Priorities: &models.Priorities{
Critical: "highest",
High: "high",
Expand Down
12 changes: 8 additions & 4 deletions pkg/models/integrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Jira struct {
ProjectKey string `yaml:"project_key,omitempty"`
IssueType string `yaml:"issue_type,omitempty"`
SeverityThreshold string `yaml:"severity_threshold,omitempty"`
PriorityThreshold string `yaml:"priority_threshold,omitempty"`
OnFixTransition string `yaml:"on_fix_transition,omitempty"`
Priorities *Priorities `yaml:"priorities,omitempty"`
Assignee *Assignee `yaml:"assignee,omitempty"`
Expand All @@ -17,10 +18,13 @@ type Jira struct {
// Mapping of Nullify Finding severities to Jira Priorities.
// The user can specify the priority of the issue based on the severity.
type Priorities struct {
Critical string `yaml:"critical,omitempty"`
High string `yaml:"high,omitempty"`
Medium string `yaml:"medium,omitempty"`
Low string `yaml:"low,omitempty"`
Critical string `yaml:"critical,omitempty"`
High string `yaml:"high,omitempty"`
Medium string `yaml:"medium,omitempty"`
Low string `yaml:"low,omitempty"`
Urgent string `yaml:"urgent,omitempty"`
Important string `yaml:"important,omitempty"`
Negligible string `yaml:"negligible,omitempty"`
}

type Assignee struct {
Expand Down
1 change: 1 addition & 0 deletions tests/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func TestIntegration(t *testing.T) {
ProjectKey: "JIRINT",
IssueType: "Nul-Finding",
SeverityThreshold: models.SeverityHigh,
PriorityThreshold: models.PriorityImportant,
OnFixTransition: "Done",
},
},
Expand Down
1 change: 1 addition & 0 deletions tests/nullify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,5 @@ integrations:
project_key: JIRINT
issue_type: Nul-Finding
severity_threshold: HIGH
priority_threshold: IMPORTANT
on_fix_transition: Done
Loading