diff --git a/examples/nullify.yaml b/examples/nullify.yaml index e0ec009..8711c59 100644 --- a/examples/nullify.yaml +++ b/examples/nullify.yaml @@ -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 diff --git a/pkg/merger/merger.go b/pkg/merger/merger.go index 9979412..e6bdd35 100644 --- a/pkg/merger/merger.go +++ b/pkg/merger/merger.go @@ -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 diff --git a/pkg/merger/merger_test.go b/pkg/merger/merger_test.go index f8cf4af..3c5c54e 100644 --- a/pkg/merger/merger_test.go +++ b/pkg/merger/merger_test.go @@ -80,6 +80,7 @@ func TestMergeConfigFiles(t *testing.T) { IssueType: "Nul-Finding", OnFixTransition: "Done", SeverityThreshold: models.SeverityHigh, + PriorityThreshold: models.PriorityImportant, }, }, }, @@ -137,6 +138,7 @@ func TestMergeConfigFiles(t *testing.T) { IssueType: "Nul-Finding", OnFixTransition: "Done", SeverityThreshold: models.SeverityHigh, + PriorityThreshold: models.PriorityImportant, }, }, }, @@ -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", @@ -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", diff --git a/pkg/models/integrations.go b/pkg/models/integrations.go index 9322981..2a3a7c7 100644 --- a/pkg/models/integrations.go +++ b/pkg/models/integrations.go @@ -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"` @@ -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 { diff --git a/tests/integration_test.go b/tests/integration_test.go index c1ff47f..e5b1ab1 100644 --- a/tests/integration_test.go +++ b/tests/integration_test.go @@ -149,6 +149,7 @@ func TestIntegration(t *testing.T) { ProjectKey: "JIRINT", IssueType: "Nul-Finding", SeverityThreshold: models.SeverityHigh, + PriorityThreshold: models.PriorityImportant, OnFixTransition: "Done", }, }, diff --git a/tests/nullify.yaml b/tests/nullify.yaml index 085482a..7113334 100644 --- a/tests/nullify.yaml +++ b/tests/nullify.yaml @@ -92,4 +92,5 @@ integrations: project_key: JIRINT issue_type: Nul-Finding severity_threshold: HIGH + priority_threshold: IMPORTANT on_fix_transition: Done