Slack notification for fail run is not happening

version: 2.1
orbs:
cypress: cypress-io/cypress@3
slack: circleci/slack@4.3.0

commands:
notify_slack_error:
steps:
- slack/notify:
event: fail
template: basic_fail_1

notify_slack_pass:
steps:
- slack/notify:
event: pass
template: basic_success_1
jobs:
notify_slack_job:
docker:
- image: cimg/base:2020.01
steps:
- notify_slack_error
- notify_slack_pass

workflows:
mybuild:
jobs:
- cypress/run:
cypress-cache-key: custom-cypress-cache-v1-{{ arch }}-{{ checksum “./CypressAutomationFHF/package.json” }}
working-directory: CypressAutomationFHF
cypress-command: “npx cypress run --spec=cypress/e2e/FHF-Dashboard//**/.smoke.js”
filters:
branches:
only:
- dev
- master
- notify_slack_job:
requires:
- cypress/run
filters:
branches:
only:
- dev
- master

Hi @prachi,

Thanks for sharing those details. It’s best practice to use the latest version of an orb when possible. In this case, I can see that the latest version of the slack orb is 4.13.2 (CircleCI Developer Hub - circleci/slack).

It is also worth noting that SLACK_ACCESS_TOKEN and SLACK_DEFAULT_CHANNEL environment variable must be set for this orb to work.

Are you seeing any errors for the failing command?