The add action is remarkably similar to the edit function. Copy the entire 'getNewValuesForTask' action from the edit function into the 'menu' element.