From fd659035307b5fc8018aa9b0739eafb82ff443d2 Mon Sep 17 00:00:00 2001 From: Justin Reynolds Date: Fri, 17 Nov 2017 07:49:59 -0800 Subject: [PATCH] feat(pagerduty): Automatically append 'from' to the details map --- .../orca/echo/tasks/PageApplicationOwnerTask.groovy | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/orca-echo/src/main/groovy/com/netflix/spinnaker/orca/echo/tasks/PageApplicationOwnerTask.groovy b/orca-echo/src/main/groovy/com/netflix/spinnaker/orca/echo/tasks/PageApplicationOwnerTask.groovy index 0c41a9c3b6..6cd6e1f424 100644 --- a/orca-echo/src/main/groovy/com/netflix/spinnaker/orca/echo/tasks/PageApplicationOwnerTask.groovy +++ b/orca-echo/src/main/groovy/com/netflix/spinnaker/orca/echo/tasks/PageApplicationOwnerTask.groovy @@ -75,6 +75,14 @@ class PageApplicationOwnerTask implements RetryableTask { } } + def details = stage.context.details + if (details == null) { + details = [:] + } + if (details["from"] == null) { + details["from"] = stage.execution.authentication.user + } + // echo service will not send a proper response back if there is an error, it will just throw an exception echoService.create( new EchoService.Notification( @@ -83,7 +91,7 @@ class PageApplicationOwnerTask implements RetryableTask { source: new EchoService.Notification.Source(user: stage.execution.authentication.user), additionalContext: [ message: stage.context.message, - details: stage.context.details + details: details ] ) )