Action

Add New Project to Things

Posted by homme, Last update almost 6 years ago - Unlisted

Add New Project to Things with Notes.

Steps

  • script

    // See online documentation for examples
    // http://drafts5-help.agiletortoise.com/
    
    var project = TJSProject.create();
    project.title = draft.processTemplate("[[line|1]]");
    project.notes = draft.processTemplate("[[line|2]]");
    
    var heading = TJSHeading.create();
    heading.title = draft.processTemplate("[[line|3]]");
    project.addHeading(heading);
    
    var todo = TJSTodo.create();
    todo.title = draft.processTemplate("[[line|4]]")
    todo.notes = draft.processTemplate("[[line|5]]")
    project.addTodo(todo);
    
    var checklistitem = TJSChecklistItem.create();
    checklistitem.title = draft.processTemplate("[[line|6]]")
    todo.addChecklistItem(checklistitem);
    
    var container = TJSContainer.create([project]);
    var cb = CallbackURL.create();
    cb.baseURL = container.url;
    var success = cb.open();
    if (success) {
    	console.log("Project created in Things");
    	}
    	else {
    	context.fail();
    	}

Options

  • After Success Trash
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.