I have a custom field (customfield_14543) with dropdown selections of Team 1, Team 2, Team 3, etc. When Team 1 is selected in the custom field, the automation will send a message to Team 1's slack channel.
When the custom field value changes (trigger) do I need to use Advanced Branching to send a slack message to that team?
@Sheri Seldes
No—Advanced Branching is not needed for this single-select dropdown use case in Jira Cloud; use a “Field value changed” trigger with an If/else block to route a “Send Slack message” action to the correct channel based on the selected team
Setup Steps
Dynamic channel mapping
Thanks
Jayesh R
Hi @Sheri Seldes -- Welcome to the Atlassian Community!
I recommend using a Lookup Table to map the field values to the Slack channel, and then use that in the rule action. This will make maintaining the rule easier. Please look here to learn more about lookup tables:
https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Create-lookup-table
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
I completely forgot about this action which is available in Jira Cloud :).
I think it is the best solution for this need
Thank for sharing this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks! So the Key would be the Team name as it is reflected in the custom field and the Value is the slack channel?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that is correct, @Sheri Seldes
For example, if your table was named varTeamToSlackChannel and customfield_14543 is a single-select option field, the result would be:
{{varTeamToSlackChannel.get(issue.customfield_14543.value)}}
I would also write that value to the audit log to help diagnose any problems in the rule later.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Sheri Seldes
I don’t use Slack myself, but according to my research, it seems that Slack channels follow this format:
https://app.slack.com/client/(workspace_id)/(channel_id)
So it’s possible to use a dynamic value if your custom field stores the Slack channel ID and here the various : {{fieldChange.toString}}
eg : https://app.slack.com/client/(workspace_id)/{{fieldChange.toString}}
However, I think it’s not very user-friendly for Jira users to have to select a channel ID instead of a channel name.
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.