Automatic Case Creation From Records In A Custom Module

Automatic Case Creation From Records In A Custom Module

HI All, 

I want to automate Case Creation and Closure from activities in a custom module. 

I can set up the workflow easy enough my issue is the deluge scripting - it's outside of my experience. (which is limited). 

For example

Based on a criteria i.e Deployment = "Problem" I then want to automate the creation of a case. This case will need to associate with the custom record ID. 

Then in order to close the loop, I want to then update the case from Closed to then send a new value in the Deployment field in the custom module as - "Complete"

Can anyone offer some assistance please?