Create Scrum Task - Analysis Task - Business Rule with Script not working

Philip Owen
Tera Contributor

Why is this script with a Business Rule not working? 

 

Scenario is that I want to create Tasks from when a story is created to prevent them manually being created. 

 

(function executeRule(current, previous /*null when async*/) {

    // Add your code here

    var gr = new GlideRecord('sn_safe_scrum_task');
    gr.Initialize();
    gr.type = '1';
    gr.short_description = "Analysis Task";
    gr.parent = current.sys_id;
    gr.insert();

})(current, previous);
 
the ge.type Discionary Entry is correct being = 1
This is to be 'inserted' 'After' so why is the task not appearing? I have the correct table as well.