Is there a way to get the current Scenario id?

I'm buiilding a macro step for an scenario in which i need to obtain the last successful run of that scenario. I've been able to get the las successful time, but I'm struggling to limit this to only the current scenario. any suggestions on how to tackle this?
Answers
-
Hi Jorge,
And what about using project.list_scenarios()?
If you prefer another approach, you can find the ID, in the URL when viewing the scenario. The URL should look like:
https:://${DATAIKU_HOST}:${DATAIKU_PORT}/projects/${PROJECT_KEY}/scenarios/${SCENARIO_ID}
Best
-
Thank you!. the issue that i'm facing is that i'm lookign to find the current scenario that is being executed.. i was able to work around by requesting to the user to input it manually and the validating agianst the list. Thank you
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,575 Neuron
@Jorge You can get the Scenario ID from within a running scenario using the "Scenario in a scenario" object inside a Custom Python script scenario step for instance:
from dataiku.scenario import Scenario
scenario = Scenario()
print(scenario.scenario_trigger['scenarioId'])