How to create a new task

For the purpose of enabling users to create tasks from your interface, add the below given form on the page:

<form method="post" enctype="multipart/form-data" 
action="${contextPath}/template/${template}/action.ftl/task/${task.number}">
<input type="hidden" name="forms_task_edit_id" value="${task.id}">
Header of the task: <input type="text" name="forms_task_edit_name" value="" size="80" maxlength="200">
Description: <textarea name="forms_task_edit_description" cols=70 rows=10></textarea>
Attached files<br>:
<input type="file" name="forms_task_edit_attachment" value="" size="70" maxlength="200"><br>
<input type="file" name="forms_task_edit_attachment" value="" size="70" maxlength="200"><br>
<input type="file" name="forms_task_edit_attachment" value="" size="70" maxlength="200"><br>
My name:<br>
<@std.saveCookies field="temp_user_name">
<input type="text" name="temp_user_name" value="${request.cookies.temp_user_name?default("")}">
</@std.saveCookies>
My email:<br>
<@std.saveCookies field="temp_user_email">
<input type="text" name="temp_user_email" value="${request.cookies.temp_user_email?default("")}">
</@std.saveCookies>
<input type="hidden" name="method" value="task_edit">
<input type="submit">
</form>

The page action.ftl (or on the other one, to which the form will be directed) must have the following code:

<@std.script>
if (request.get("value").get("method")!=null && request.get("value").get("method").equals("task_edit")) {
    if (!Util.validateCreateCategory(task, "bug")) {
  return "";
}
 String prefix="";
 if (request.get("value").get("temp_user_name")!=null) {
 prefix+="From: "+request.get("value").get("temp_user_name")+"\n";
 }
 if (request.get("value").get("temp_user_email")!=null){
  prefix+="Email: "+request.get("value").get("temp_user_email")+"\n";
 }
  String taskName_1 = request.get("value").get("forms_task_edit_name");
  String taskDescription_1 = request.get("value").get("forms_task_edit_description");
  String taskId = request.get("value").get("forms_task_edit_id");
  String taskCategory_1 = CSVImport.findCategoryIdByName("bug");
  SecuredTaskTriggerBean newTask = new SecuredTaskTriggerBean(taskId, prefix+taskDescription_1,taskName_1, 
null, null, null, null, null, null, 
null, null, sc.getUserId(), task.getHandlerId(), 
task.getHandlerUserId(), task.getHandlerGroupId(), taskId, taskCategory_1,
null, null, null,  null,  null, sc).create();

  Uploader.upload(newTask);
 return newTask.getNumber();
}
return "";
</@std.script>

It is clear from the above code that the task is created through Beanshell-script, in which a simple SecuredTaskTriggerBean is generated. You can use your own beanshell-scripts in the templates.