Skip to content

How to move an item #28

Answered by olsh
matz33 asked this question in Q&A
Apr 11, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @matz33

You should use ItemMoveArgument.CreateMoveToProject to create the ItemMoveArgument instance.

  // Create two projects
  var firstProjectId = await client.Projects.AddAsync(new Project("First"));
  var secondProjectId = await client.Projects.AddAsync(new Project("Second"));

  // Create an item in the first project
  var itemId = await client.Items.AddAsync(new Item("Test task", firstProjectId));

  // Move the item to the second project
  await client.Items.MoveAsync(ItemMoveArgument.CreateMoveToProject(itemId, secondProjectId));

Also, the ItemMoveArgument has other static methods for other cases.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@matz33
Comment options

Answer selected by matz33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants