Hi. I'm trying to create an automation flow that will send a message to a Slack channel that corresponds to the selected value when the user changes the value of a specific field (in this case, it's a custom field).
This was previously implemented with IF/ELSE blocks, but I'm looking to optimise the automation to cut down on automation steps given Atlassian's coming change in automation billing.
I'm trying to use a lookup table where the keys are the possible selectable values for the custom field, and the values are the unique Slack Webhook tokens for different slack channels.
I want the automation to read the updated custom field value, read the Slack webhook token that matches that value, then posts a message to Slack in the channel matching that token.
My flow as it currently stands is:
- Trigger: Value changes for (custom field)
- Create Variable: variableName = {{issue.customfield_xxxxx.value}}
- Create Lookup Table: webhookTable
- Key: the potential selectable customfield_xxxxx values
- Value: the Slack webhook tokens that correspond to the customfield_xxxxx value selected.
- Send Slack Message via webhook: the webhook URL is being constructed as "https://hooks.slack.com/services/{{webhookTable.get({{variableName}})
When I trigger this flow, it also reports the same error at the "Send Slack Message via webhook" step:
"Unable to render smart values when executing this flow:Failed to get value for webhookTable.get({{variableName: https://hooks.slack.com/services/{{webhookTable.get({{variableName}})"
(Exact names have been modified for privacy/security).
If it matters, the custom field is a "Select List (single choice)" type.
What am I missing here that is causing this flow to fail?
Subquestion: the webhook tokens do contain "/" characters, so do I have to escape them in some way, and if so, how?
—
Addendum: I changed the Webhook URL to be constructed as:
https://hooks.slack.com/services/{{webhookTable.get(variableName)}}
When I run that, I now get "Error from Slack [301]"
Thanks for any help.