Below is the sample code, when there is a change in Assigned To user field an email will be send to that person. We post the below code in Bug AfterPost Event.
If Bug_Fields.field("BG_RESPONSIBLE").IsModified Then
mailTo = Bug_Fields.Field("BG_RESPONSIBLE").value
set objBug = TDConnection.BugFactory.Item(Bug_Fields.Field("BG_BUG_ID").Value)
objBug.Mail mailTo,mailCC,mailopt,subject,comment
End if
Depending on the action that you want to perform we place the code in the respective events in the workflow modules.
Hope this helps you.
Regards,
Deepika P