https://prefect.io logo
#prefect-community
Title
# prefect-community
s

Sudharshan B

10/20/2022, 11:23 AM
I'm trying to post a message logs in slack after the flow gets to success. But it shows None as the message for some reason. I have used the same function for failure and it works fine on it. Is there any function for getting the set of data on slack for successfully completed prefect flows?
b

Bianca Hoch

10/20/2022, 2:28 PM
Hello Sudharshan, can you share a minimum reproducible example of how you configured the slack notification in your code?
s

Sudharshan B

10/21/2022, 6:48 AM
Hi, @Bianca Hoch
Copy code
def post_to_slack_on_success(task, old_state, new_state):
    if new_state.is_successful():
        print(new_state)
        print(old_state)
        print("Result  :  ", new_state.result, new_state.message)