Skip to content

Instantly share code, notes, and snippets.

@DeeJayTC
Last active February 15, 2019 17:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save DeeJayTC/8164365d9ae9e3750875627d11a9ddb6 to your computer and use it in GitHub Desktop.
// Create a new TodoItem instance
var newTask = new TodoItem() {
Description = "This is a new task we want to add",
Content = "The Title for my new task"
};
// And add it as task to a project
// tasklist id can be left blank, the task will be added to an "Inbox" tasklist
// also we can add it as a subtask and assign the parenttask
var result = await client.Projects.Projects.AddTodoItem(
pTodoItem: newTask,
pProjectId: TheProjectId,
pTaskListId: TheTaskListId
pIsSubTask: IsSubTask
pParentTask: ParentTask);
//if we want to we can complete our newly created task right away,
//the result will be the taskid of the newly created task
var ok = await client.Projects.Tasks.CompleteTask(result.Id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment