Q: Can I create a task for a user story with Rally SDK? We have a common set of tasks that we add to most of our user stories. Currently we are adding those tasks manually and would like to automate it.
I have seen a solution using the Rest API but we would rather use Custom App within Rally to keep it all integrated.
I have not found any samples showing how to create tasks using the Rally SDK. 

A: I'd check out this example in the docs, which shows how to use a model to do a full create/read/update/delete cycle:
https://help.rallydev.com/apps/2.0/doc/#!/guide/data_models
For a task the create would look something like this:
Rally.data.ModelFactory.getModel({
    type: 'Task',
    success: function(taskModel) {
        var newTask = Ext.create(taskModel, {
            Name: 'Do it',
            WorkProduct: '/hierarchicalrequirement/12345' //the story to link it to
        });
        newTask.save({
            callback: function(result, operation) {
                if(operation.wasSuccessful()) {
                    console.log('created task', result.get('ObjectID'));
                }
            }
        });
    }
});

