Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add update original message to destination configurations #1177

4 changes: 4 additions & 0 deletions pkg/workflows/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ type AiWorkflowsDestinationConfiguration struct {
NotificationTriggers []AiWorkflowsNotificationTrigger `json:"notificationTriggers"`
// Type of the Destination Configuration
Type AiWorkflowsDestinationType `json:"type"`
// Update original notification message (Slack channels only)
UpdateOriginalMessage *bool `json:"updateOriginalMessage,omitempty"`
}

// AiWorkflowsDestinationConfigurationInput - Destination Configuration input object
Expand All @@ -433,6 +435,8 @@ type AiWorkflowsDestinationConfigurationInput struct {
ChannelId string `json:"channelId"`
// notificationTriggers
NotificationTriggers []AiWorkflowsNotificationTrigger `json:"notificationTriggers"`
// updateOriginalMessage
UpdateOriginalMessage *bool `json:"updateOriginalMessage,omitempty"`
}

// AiWorkflowsEnrichment - Makes it possible to augment the notification with additional data from the New Relic platform
Expand Down
3 changes: 3 additions & 0 deletions pkg/workflows/workflows_api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkg/workflows/workflows_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestIntegrationCreateWorkflow(t *testing.T) {
defer cleanupDestination(t, destination)

notificationTriggers := []AiWorkflowsNotificationTrigger{"ACTIVATED"}

var expectedUpdateOriginalMessage *bool = nil
// Create a workflow to work with in this test
workflowInput := generateCreateWorkflowInput(channel, notificationTriggers)

Expand Down Expand Up @@ -63,6 +63,7 @@ func TestIntegrationCreateWorkflow(t *testing.T) {
require.Equal(t, len(workflowInput.DestinationConfigurations), len(createdWorkflow.DestinationConfigurations))
require.Equal(t, workflowInput.DestinationConfigurations[0].ChannelId, createdWorkflow.DestinationConfigurations[0].ChannelId)
require.Equal(t, workflowInput.DestinationConfigurations[0].NotificationTriggers, createdWorkflow.DestinationConfigurations[0].NotificationTriggers)
require.Equal(t, expectedUpdateOriginalMessage, createdWorkflow.DestinationConfigurations[0].UpdateOriginalMessage)
}

func TestIntegrationCreateWorkflowWithoutNotificationTriggers(t *testing.T) {
Expand Down
Loading