Need help with script - Event to Deal

Need help with script - Event to Deal

Hi,

I'm trying to create a script that is supposed to do the following:

If an "Event" is related to a "Deal“ and the "Stage“ = "Targeted“ → set  Stage to "Scheduled“

can someone help me with a function (as part of an automation that will be triggered when an event is updated.

Thx!!