-
Suggestion
-
Resolution: Duplicate
-
None
-
None
-
0
-
Send Webhook request allows smart values for Webhook URL.
Microsoft Teams and Slack both do not allow smart values.
How to reproduce
Create new rule:
- When: Scheduled: Advanced Cron: 0 0 0 1 1 ? 1970
- Then: Create variable:
- Variable name: url
- Smart value: https://<tenancy name>.webhook.office.com/webhookb2/<channel GUID>/IncomingWebhook/<webhook GUID>
- And: Send Microsoft Teams message:
- Webhook URL: {
Unknown macro: { url}
}
- Message title: Test notification
- Message: This is a test notification
- Include summary in message
- Webhook URL: {
Publish rule
Expected behaviour
Rule published; can execute with "Run Now".
Actual behaviour
Rule does not publish: an alert is registered against "Webhook URL" field in "Send Microsoft Teams message" action
Impact
Low; can be worked around with reasonable difficulty. The main reason for this is to simplify rule management, and to allow the webhook URL to be extracted from other sources, eg. an Insight object attribute or an Issue entity property.
Workaround
Send an outgoing webhook instead:
- Webhook URL: {
Unknown macro: { url}
}
- Headers: Content-Type: application/json
- HTTP method: POST
- Webhook body: custom data
- Custom data:
{ "summary": "{{issue.key}} {{issue.summary.jsonEncode}}", "sections": [ { "activityTitle": "{{issue.VIP}}{{#if(exists(issue.priority))}} 👆 {{issue.priority.name.jsonEncode}}{{/}} ⏰ {{issue.Time to Resolution.ongoingCycle.remainingTime.friendly.jsonEncode}} 👩💼 {{reporter.displayName.jsonEncode}}{{#if(exists(issue.Affected Services))}} ⚙ {{issue.affectedServices.name.join(",").jsonEncode}}{{/}}", "activitySubtitle": "", "activityImage": "https://d283vu6e5qi87p.cloudfront.net/automation/prod/automation-logo.svg", "activityText": "* Assigned by: {{initiator.displayName.jsonEncode}}\n* Reporter: {{issue.reporter.displayName.jsonEncode}}{{#if(exists(issue.Affected Contact))}}\n* Affected Contact: {{issue.Affected Contact.displayName.jsonEncode}}{{/}}{{#if(exists(issue.Affected Services))}}\n* Affected Services: {{issue.affectedServices.name.join(",").jsonEncode}}{{/}}" }, { "activityTitle": "{{issue.key}} {{issue.summary.jsonEncode}}", "facts": [ { "name": "Status", "value": "{{issue.status.jsonEncode}}" }, { "name": "Issue type", "value": "{{issue.issuetype.name.jsonEncode}}" }, { "name": "Assignee", "value": "{{#if(exists(issue.assignee))}}{{issue.assignee.name.jsonEncode}}{{/}}{{#if(not(exists(issue.assignee)))}}Unassigned{{/}}" } ] } ], "potentialAction": [], "themeColor": "fd5a00", "@context": "http://schema.org/extensions", "@type": "MessageCard" }
The Slack action further validates that the webhook URL is for the Slack domain, not useful if users want to use a middle layer application to collect these notifications. The same workaround is available for Slack.
- duplicates
-
AUTO-443 Improve Microsoft Teams action - Tagging User in comments generates MS Teams message in user's individual chat, support smart values, support private channels
- Gathering Interest