Skip to content

Commit

Permalink
feat(workflows): adds new notification_trigger type INVESTIGATING (
Browse files Browse the repository at this point in the history
…#2805)

feat(workflows): adds new `notification_trigger` type `INVESTIGATING` (#2805)
  • Loading branch information
shubh-0708 authored Feb 3, 2025
1 parent b65320f commit ca33470
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/mitchellh/go-homedir v1.1.0
github.com/newrelic/go-agent/v3 v3.30.0
github.com/newrelic/go-insights v1.0.3
github.com/newrelic/newrelic-client-go/v2 v2.52.0
github.com/newrelic/newrelic-client-go/v2 v2.53.0
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ github.com/newrelic/go-agent/v3 v3.30.0 h1:ZXHCT/Cot4iIPwcegCZURuRQOsfmGA6wilW+S
github.com/newrelic/go-agent/v3 v3.30.0/go.mod h1:9utrgxlSryNqRrTvII2XBL+0lpofXbqXApvVWPpbzUg=
github.com/newrelic/go-insights v1.0.3 h1:zSNp1CEZnXktzSIEsbHJk8v6ZihdPFP2WsO/fzau3OQ=
github.com/newrelic/go-insights v1.0.3/go.mod h1:A20BoT8TNkqPGX2nS/Z2fYmKl3Cqa3iKZd4whzedCY4=
github.com/newrelic/newrelic-client-go/v2 v2.52.0 h1:aY8502kV0IlIeOu1c9B/kLWN1je4NEwFFJ/FN2hMoyQ=
github.com/newrelic/newrelic-client-go/v2 v2.52.0/go.mod h1:+RRjI3nDGWT3kLm9Oi3QxpBm70uu8q1upEHBVWCZFpo=
github.com/newrelic/newrelic-client-go/v2 v2.53.0 h1:Quv3stsXcn56vE5p4KAFL8N2gO11B1l5/+kbdp74fZ4=
github.com/newrelic/newrelic-client-go/v2 v2.53.0/go.mod h1:+RRjI3nDGWT3kLm9Oi3QxpBm70uu8q1upEHBVWCZFpo=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
Expand Down
27 changes: 27 additions & 0 deletions newrelic/resource_newrelic_workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,33 @@ import (
"github.com/newrelic/newrelic-client-go/v2/pkg/ai"
)

func TestNewRelicWorkflow_WithInvestigatingNotificationTriggers(t *testing.T) {
resourceName := "newrelic_workflow.foo"
rName := generateNameForIntegrationTestResource()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheckEnvVars(t) },
Providers: testAccProviders,
CheckDestroy: testAccNewRelicWorkflowDestroy,
Steps: []resource.TestStep{
// Test: Create workflow
{
Config: testAccNewRelicWorkflowConfigurationWithNotificationTriggers(testAccountID, rName, `["ACTIVATED", "INVESTIGATING"]`),
Check: resource.ComposeTestCheckFunc(
testAccCheckNewRelicWorkflowExists(resourceName),
),
},
// Test: Update workflow
{
Config: testAccNewRelicWorkflowConfigurationWithNotificationTriggers(testAccountID, fmt.Sprintf("%s-updated", rName), `["ACTIVATED", "INVESTIGATING", "CLOSED"]`),
Check: resource.ComposeTestCheckFunc(
testAccCheckNewRelicWorkflowExists(resourceName),
),
},
},
})
}

func TestNewRelicWorkflow_Webhook(t *testing.T) {
resourceName := "newrelic_workflow.foo"
rName := generateNameForIntegrationTestResource()
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/workflow.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ One could, for example, configure a workflow to open a Jira ticket and send Slac
Possible values:
* `ACTIVATED` - Send a notification when an issue is activated
* `ACKNOWLEDGED` - Send a notification when an issue is acknowledged
* `INVESTIGATING` - Send a notification when an issue is being investigated
* `PRIORITY_CHANGED` - Send a notification when an issue's priority has been changed
* `CLOSED` - Send a notification when an issue is closed
* `OTHER_UPDATES` - Send a notification on other updates on the issue. These updates include:
Expand Down

0 comments on commit ca33470

Please sign in to comment.