diff --git a/step-templates/slack-send-notification-using-block-kit.json b/step-templates/slack-send-notification-using-block-kit.json index 90c5a2240..660447e90 100644 --- a/step-templates/slack-send-notification-using-block-kit.json +++ b/step-templates/slack-send-notification-using-block-kit.json @@ -3,13 +3,13 @@ "Name": "Slack - Send Notification using Block Kit", "Description": "Send a message notification to Slack using the Block Kit formatting. These messages will be limited to more basic formats (e.g., using functions and inputs probably won't work), but you still will be able to make much nicer looking messages this way with the ability to preview them using the [Block Kit Builder](https://app.slack.com/block-kit-builder).", "ActionType": "Octopus.Script", - "Version": 2, + "Version": 3, "CommunityActionTemplateId": null, "Packages": [], "Properties": { "Octopus.Action.Script.ScriptSource": "Inline", "Octopus.Action.Script.Syntax": "PowerShell", - "Octopus.Action.Script.ScriptBody": "$payload = ($OctopusParameters['ssn_BlockObj'] | ConvertFrom-Json)\n$payload | Add-Member -MemberType NoteProperty -Name channel -Value $OctopusParameters['ssn_Channel']\n$payload | Add-Member -MemberType NoteProperty -Name username -Value $OctopusParameters['ssn_Username']\n$payload | Add-Member -MemberType NoteProperty -Name icon_url -Value $OctopusParameters['ssn_IconUrl']\n$payload | Add-Member -MemberType NoteProperty -Name link_names -Value \"true\"\n\ntry {\n\t[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls12\n if ($PSVersionTable.PSVersion.Major -ge 6)\n {\n Invoke-Restmethod -Method POST -Body ($payload | ConvertTo-Json -Depth 10) -Uri $OctopusParameters['ssn_HookUrl']\n }\n else\n {\n Invoke-Restmethod -Method POST -Body ($payload | ConvertTo-Json -Depth 10) -Uri $OctopusParameters['ssn_HookUrl'] -UseBasicParsing\n }\n} catch {\n Write-Host \"An error occurred while attempting to send Slack notification\"\n Write-Host $_.Exception\n Write-Host $_\n throw\n}" + "Octopus.Action.Script.ScriptBody": "$payload = ($OctopusParameters['ssn_BlockObj'] | ConvertFrom-Json)\n$payload | Add-Member -MemberType NoteProperty -Name channel -Value $OctopusParameters['ssn_Channel']\n$payload | Add-Member -MemberType NoteProperty -Name username -Value $OctopusParameters['ssn_Username']\n$payload | Add-Member -MemberType NoteProperty -Name icon_url -Value $OctopusParameters['ssn_IconUrl']\n$payload | Add-Member -MemberType NoteProperty -Name link_names -Value \"true\"\n\ntry {\n\t[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls13 -bor [System.Net.SecurityProtocolType]::Tls12 -bor [Net.SecurityProtocolType]::Tls11\n if ($PSVersionTable.PSVersion.Major -ge 6)\n {\n Invoke-Restmethod -Method POST -Body ($payload | ConvertTo-Json -Depth 10) -Uri $OctopusParameters['ssn_HookUrl']\n }\n else\n {\n Invoke-Restmethod -Method POST -Body ($payload | ConvertTo-Json -Depth 10) -Uri $OctopusParameters['ssn_HookUrl'] -UseBasicParsing\n }\n} catch {\n Write-Host \"An error occurred while attempting to send Slack notification\"\n Write-Host $_.Exception\n Write-Host $_\n throw\n}" }, "Parameters": [ { @@ -65,10 +65,10 @@ ], "StepPackageId": "Octopus.Script", "$Meta": { - "ExportedAt": "2023-06-02T20:17:55.244Z", - "OctopusVersion": "2023.3.1205-hotfix.1753", + "ExportedAt": "2025-25-03T10:29:69.420Z", + "OctopusVersion": "2025.2.3087", "Type": "ActionTemplate" }, "LastModifiedBy": "justin-newman", "Category": "slack" -} \ No newline at end of file +}