Pending Approval notification

Hi, I was wondering if anyone could help with some functionality?
I’ve had a quick look in the forum and online but couldn’t see anything related to what we are trying to do.

Basically, on the pending-approval step. You have an output like Step has been approved by: some-name What I’d like to do is pass that name to a slack message in the next step. Is this even possible?


Yes, this is possible by using the Step Member Variables, the Approval step have the following variables exposed:

  • authEntity.type

So you can get the name in the following step by using this variable: ${{<Approval_step_name>}}

Thats brilliant thanks. I did spot those vars elsewhere but didn’t realise they were members of that step :+1:

Hi I’m trying to do this too but I can’t seem to get it to work. Any suggestions? Thanks!

My pipeline looks like this:

version: 1.0

      type: pending-approval
      title: Deploy to production?
      fail_fast: false
        duration: 2
        finalState: denied
        timeUnit: hours
    type: slack-post-channel
      SLACK_CHANNEL: "#elisha-test"
      SLACK_MESSAGE: "${{}}"

But my slack message shows: ${{}}

I also tried with SLACK_MESSAGE: "${{}}" but again my slack message is: ${{}}


We got ours working well. Here’s a snippet of the code we’ve used. We are exporting the variable to send to another pipeline, but in essence what you’ve used in ${{}} should work I would say.

another test would be add a step like the below but with the command - echo ${{}}

    stage: deploy-to-uat
    type: freestyle
    title: UAT Approval
    image: "gradle:7-jdk11-alpine"
      - export UAT_APPROVER=${{}}
      - cf_export UAT_APPROVER