I am in the process of configuring an Octopus webhook notification that will update an application record in ServiceNow using the info sent via the notification. The problem is that I want this notification sent when a deployment is successful so I can then get the application name and the release version that was deployed and use that to update the app’s ServiceNow record, but none of the notification payloads have the data pair that I want to make it easier to setup.
I did find the data pair in a release document notification for when a release is created. The code I am looking for is below in bold.
“ChangeDetails”: {
“DocumentContext”: {
“Id”: “Releases-86813”,
“SpaceId”: “Spaces-1”,
“ProjectId”: “Projects-2501”,
“ChannelId”: “Channels-2801”,
“Version”: “1.0.0.47-documenttest”,
“ReleaseNotes”: null,
“Assembled”: “2023-05-10T11:03:52.136-05:00”,
“ReleaseDefects”: [],
“DeploymentSettings”: {
“DefaultToSkipIfAlreadyInstalled”: false,
“ConnectivityPolicy”: {
“SkipMachineBehavior”: “None”,
“TargetRoles”: [],
“AllowDeploymentsToNoTargets”: false,
“ExcludeUnhealthyTargets”: false
},
“DefaultGuidedFailureMode”: “EnvironmentDefault”,
“DeploymentChangesTemplate”: null,
“VersioningStrategy”: {
“DonorPackage”: {
“DeploymentActionId”: “703024cc-eb38-41d6-9a62-c2aa5ba4cbff”,
“PackageReferenceId”: “a562056d-31a6-4f86-9d99-9c5e4ad450c8”
},
“Template”: null
},
“ForcePackageDownload”: false
},
“ProjectVariableSetSnapshotId”: “variableset-Projects-2501-s-0-N4HV6”,
“ProjectDeploymentProcessSnapshotId”: “deploymentprocess-Projects-2501-s-4-GLNCL”,
“LibraryVariableSetSnapshots”: [],
“ProvisioningRunbookProcessId”: null,
“DeprovisioningRunbookProcessId”: null,
“SelectedPackages”: [
{
“ActionName”: “Deploy a Package”,
“PackageReferenceName”: “”,
“Version”: “1.0.0.47”
}
],
“ProvisioningPackages”: [],
“DeprovisioningPackages”: [],
“BuildInformation”: [],
“VersionControlReference”: {
“VariablesGitCommit”: null,
“GitRef”: null,
“GitCommit”: null
}
},
“Differences”: []
},
Is there a way to configure a Release Successfully Deployed notification so that info is sent? Below is a sample of the payload from the successful deployment notification so you can see that the version is not defined the same way. The only place the version is mentioned is in the message body.
"Subscription": {
"Id": "Subscriptions-41",
"Name": "SN Test",
"Type": "Event",
"IsDisabled": false,
"EventNotificationSubscription": {
"Filter": {
"Users": [],
"Projects": [
"Projects-2501"
],
"ProjectGroups": [],
"Environments": [],
"EventGroups": [],
"EventCategories": [
"DeploymentSucceeded"
],
"EventAgents": [],
"Tenants": [],
"Tags": [],
"DocumentTypes": []
},
"EmailTeams": [
"Teams-1022"
],
"EmailFrequencyPeriod": "00:05:00",
"EmailPriority": "Normal",
"EmailDigestLastProcessed": "2023-05-10T10:50:38.078-05:00",
"EmailDigestLastProcessedEventAutoId": 763513,
"EmailShowDatesInTimeZoneId": "Central Standard Time",
"WebhookURI": "https://webhook.site/5e08f2c1-9394-4a4f-a322-a56b92a21e3e",
"WebhookTeams": [],
"WebhookTimeout": "00:00:10",
"WebhookHeaderKey": null,
"WebhookHeaderValue": null,
"WebhookLastProcessed": "2023-05-10T10:52:08.637-05:00",
"WebhookLastProcessedEventAutoId": 763519
},
"SpaceId": "Spaces-1",
"Links": {
"Self": "/api/Spaces-1/subscriptions/Subscriptions-41"
}
},
"Event": {
"Id": "Events-686201",
"RelatedDocumentIds": [
"Deployments-143035",
"Projects-2501",
"Releases-86812",
"Environments-1",
"ServerTasks-338345",
"Channels-2801"
],
"Category": "DeploymentSucceeded",
"UserId": "users-system",
"Username": "system",
"IsService": false,
"IdentityEstablishedWith": "",
"UserAgent": "Server",
"Occurred": "2023-05-10T15:52:16.326+00:00",
"Message": "Deploy to Dev succeeded for AuddlyApplicationTest release 1.0.0.47-payloadtest to Dev",
"MessageHtml": "<a href='#/deployments/Deployments-143035'>Deploy to Dev</a> succeeded for <a href='#/projects/Projects-2501'>AuddlyApplicationTest</a> release <a href='#/releases/Releases-86812'>1.0.0.47-payloadtest</a> to <a href='#/environments/Environments-1'>Dev</a>",
"MessageReferences": [
{
"ReferencedDocumentId": "Deployments-143035",
"StartIndex": 0,
"Length": 13
},
{
"ReferencedDocumentId": "Projects-2501",
"StartIndex": 28,
"Length": 21
},
{
"ReferencedDocumentId": "Releases-86812",
"StartIndex": 58,
"Length": 20
},
{
"ReferencedDocumentId": "Environments-1",
"StartIndex": 82,
"Length": 3
}
],
"Comments": null,
"Details": null,
"ChangeDetails": {
"DocumentContext": null,
"Differences": null
},
"IpAddress": null,
"SpaceId": "Spaces-1",
"Links": {
"Self": "/api/events/Events-686201"
}
},