Subscription Payload Event MessageHtml URLs

Webhook POSTs will contain a subkey that looks like this:
Deploy to Local Guided Failure encountered guided failure for Guided Failure release 0.0.2 to Local Guided Failure

Is there guidance on concatenating the resource with the server uri?
Currently, I’m using regex to discern the DocType and DocID and reformating the url to <SERVER_URL>/#/<RESOURCE_TYPE>/DocID

e.g. /r/Release-42 = http://localhost/#/release/Release-42

Hi Jai,

Thanks for getting in touch!

We have the following Octopus variable #{Octopus.Web.BaseUrl} that will give you the http://localhost/ (or similar) of your Octopus server, so you can use that to build up your URLs (you also need to add app as that is where the entry point to the Web UI is). E.g. #{Octopus.Web.BaseUrl}/app#/releases/Release-42.

Hope that helps!

Thank you and best regards,
Henrik

Hi Henrik,

It says in the docs (http://docs.octopusdeploy.com/display/OD/System+variables) that Octopus.Web.BaseUrl is deprecated as of Octopus v2, what’s the replacement?

Thanks
David

I am receiving the events as a webhook which means I have no octopus variables to access.

Even then, the issue is /r/{ID} is not a valid part of a URI wher /r/ has to be discerned by the webhook receiver (?).

{
   "Timestamp":"2016-12-23T20:17:27.8180093+00:00",
   "EventType":"SubscriptionPayload",
   "Payload":{
      "ServerUri":"http://localhost",
      "ServerAuditUri":"http://localhost/#/configuration/audit?eventCategories=GuidedFailureInterruptionRaised&from=2016-12-23T20%3a16%3a57.%2b00%3a00&to=2016-12-23T20%3a17%3a27.%2b00%3a00",
      "BatchProcessingDate":"2016-12-23T20:17:27.8120227+00:00",
      "Subscription":{
         "Id":"Subscriptions-1",
         "Name":"Guided Intervention Test",
         "Type":0,
         "IsDisabled":false,
         "EventNotificationSubscription":{
            "Filter":{
               "Users":[

               ],
               "Projects":[

               ],
               "Environments":[

               ],
               "EventGroups":[

               ],
               "EventCategories":[
                  "GuidedFailureInterruptionRaised"
               ],
               "Tenants":[

               ],
               "Tags":[

               ]
            },
            "EmailTeams":[

            ],
            "EmailFrequencyPeriod":"01:00:00",
            "EmailDigestLastProcessed":null,
            "EmailShowDatesInTimeZoneId":"Central Standard Time",
            "WebhookURI":"http://requestb.in/14a0and1",
            "WebhookTeams":[

            ],
            "WebhookLastProcessed":"2016-12-23T20:16:57.774638+00:00"
         },
         "Links":{
            "Self":{

            }
         }
      },
      "Event":{
         "Id":"Events-449",
         "RelatedDocumentIds":[
            "Deployments-62",
            "Projects-21",
            "Releases-42",
            "Environments-2"
         ],
         "Category":"GuidedFailureInterruptionRaised",
         "UserId":"users-system",
         "Username":"system",
         "IdentityEstablishedWith":"Unknown",
         "Occurred":"2016-12-23T20:17:05.3346986+00:00",
         "Message":"Deploy to Local Guided Failure encountered guided failure  for Guided Failure release 0.0.2 to Local Guided Failure",
         "MessageHtml":"<a href='/r/Deployments-62'>Deploy to Local Guided Failure</a> encountered guided failure  for <a href='/r/Projects-21'>Guided Failure</a> release <a href='/r/Releases-42'>0.0.2</a> to <a href='/r/Environments-2'>Local Guided Failure</a>",
         "MessageReferences":[
            {
               "ReferencedDocumentId":"Deployments-62",
               "StartIndex":0,
               "Length":30
            },
            {
               "ReferencedDocumentId":"Projects-21",
               "StartIndex":63,
               "Length":14
            },
            {
               "ReferencedDocumentId":"Releases-42",
               "StartIndex":86,
               "Length":5
            },
            {
               "ReferencedDocumentId":"Environments-2",
               "StartIndex":95,
               "Length":20
            }
         ],
         "Comments":null,
         "Details":null,
         "Links":{
            "Self":{

            }
         }
      }
   }
}

David,

We brought that variable back as we got a lot of feedback that customers were using that variable.

I’ll update our docs to no longer say it has been deprecated.

Thank you,
Henrik

Great, thanks.

It’d be useful if the output of it was configurable – much in the same way that Teamcity lets you configure the server base url. Reason being, our real server name is something like “ABCD1234BG12”, whereas we have a DNS alias of “Octopus” – clearly the latter is what you’d want to return from the variable rather than the former, as that’s what people know it by :-).

Hi David,

The way we construct the #{Octopus.Web.BaseUrl} is by looking at the bindings that have been configured for your Octopus server, so if you add a binding for the DNS Alias you have, that should be used instead of the server name. (E.g. add a binding for http://Octopus and that would be used)

I hope that helps!

Thank you and best regards,
Henrik

Hi Jai,

I’ve raised issue #3109 to make the links in the event payload point to the actual location of the referenced document. I.e. /r/Releases-1 will become /#/releases/Releases-1 etc.

Thank you and best regards,
Henrik

Looks like this is still not implemented in the latest release. We cannot link back to octopus from our notification using the links as published Can we get a status update on when this is likely to be implemented. it’s been months since this was reported.