Using Script Scenario

Solved!
radiantly
Level 2
Using Script Scenario

The Webhook URL of a MS Teams channel can be used in the 'Reporter' to send scenario related messages to that Teams channel. However, I would like to know whether or not it possible to send messages to the same MS Teams channel programmatically using Dataiku Scenario API.

I simply want to use two separate channels (mail and MS Teams) to send messages using scripts.

Would like to know 'why' if this is not a possibility.

Thank you.


######### Script Scenario Starts #########

# 1. Import scenario.
from dataiku.scenario import Scenario

# 2. Initialize scenario object.
scenario = Scenario()


# 3. Do something here using methods from the scenario object.
# scenario.some_method()


# 4. Send custom reports using mail messaging channel     (THIS STEPS WORKS FINE)
sender = scenario.get_message_sender("dss_notifications", type=None)
sender.set_params(sender="name@company.com", recipient="name@company.com")
sender.send(subject="The scenario is doing well", message="All is good")


# 5. Send custom reports to a MS channel                           (HOW to MAKE THIS STEP WORK?)
????

######### Script Scenario Ends #########

0 Kudos
1 Solution
radiantly
Level 2
Author

@Turribeach Thank you for the pointer. Much appreciated. The documentation is not very helpful. After a bit of trial and error I found the right way to make MS Teams messing works. Sharing my struggle as an image so that someone else can find it handy. 

Note that "channel_id" for MS Teams messaging is not the name of the Teams channel name. This is where I got confused. This is the 'id' set by the DSS admin in the DSS setting tab. This connection communicates to the MS Teams channel vis the webhook URL that you create when you register your Teams channel.   

View solution in original post

0 Kudos
2 Replies
Turribeach

Please always use code blocks for your code (the </> icon the toolbar). What you want to do is documented here:

https://doc.dataiku.com/dss/latest/scenarios/custom_scenarios.html#send-custom-reports

 

0 Kudos
radiantly
Level 2
Author

@Turribeach Thank you for the pointer. Much appreciated. The documentation is not very helpful. After a bit of trial and error I found the right way to make MS Teams messing works. Sharing my struggle as an image so that someone else can find it handy. 

Note that "channel_id" for MS Teams messaging is not the name of the Teams channel name. This is where I got confused. This is the 'id' set by the DSS admin in the DSS setting tab. This connection communicates to the MS Teams channel vis the webhook URL that you create when you register your Teams channel.   

0 Kudos