Conditional notification with message

I’m having trouble with the notify option in my BK pipeline. I seem to be able to do this:

notify:
  - slack: '#my_channel'
    if: build.state == "passed"

…or this:

notify:
  - slack:
      channels:
        - '#my_channel'
      message: 'something bad happened'

…but not this (or any other variant like it; BK complains about not knowing what “if” is or not being able to find an expected key or various other errors):

notify:
  - slack: '#my_channel'
    if: build.state == "passed"
    message: ':white_check_mark: success! :white_check_mark:'

Any suggestions?

Welcome to the community @narwold and thanks for bringing this up. I have reproduced this on my side and am checking with the team whether this is intended behavior. It does seem like we should allow this…

Thanks much!

Hey @narwold! I think this may work?

notify:
  - slack:
      channels: '#my_channel'
      message: ':white_check_mark: success! :white_check_mark:' 
    if: build.state == "passed"

That worked; thanks!

1 Like