I'm trying to post a message logs in slack after t...
# prefect-community
s
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
Hello Sudharshan, can you share a minimum reproducible example of how you configured the slack notification in your code?
s
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)