Opportunities, Tasks and ToDoist for SugarCRM — part I

Subject

When new Opportunity created or its status changed, new Task to be created and also new Task in ToDoist application to be created.
Optional: when Opportunity is closed, all open Tasks to be closed as well, also on ToDoist.