Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CMDLET to delete workitem #209

Closed
wants to merge 26 commits into from
Closed

Added CMDLET to delete workitem #209

wants to merge 26 commits into from

Conversation

SebastianSchuetze
Copy link
Collaborator

@SebastianSchuetze SebastianSchuetze commented Oct 19, 2019

PR Summary

I added a new cmdlet to delete work items by IDs. I

So the following things were added:

  • cmdlet Remove-VSTeamWiql
    • added also the switch parameter "Destroy" to also permanently delete the work item instead on putting it to the recycle bin
  • added a format file for the cmdelet
  • added a type file for the cmdlet

PR Checklist

@SebastianSchuetze SebastianSchuetze changed the title added workitem deletion cmdlet Added CMDLET to delete workitem Oct 19, 2019
@SebastianSchuetze SebastianSchuetze marked this pull request as ready for review October 20, 2019 11:38
@SebastianSchuetze
Copy link
Collaborator Author

@DarqueWarrior I accidentally merged the other topic branch into this one in the beginning. So it shows the history of the not yet merged PR and also the comments above. I don't know if that will be a problem.

@DarqueWarrior
Copy link
Collaborator

Make sure you run

.\Build-Module.ps1 -analyzeScript -ipmo

And clear any messages.

I am a big unclear why we need _applyTypesToWorkItemDeleted and can't use _applyTypesToWorkItem

@DarqueWarrior
Copy link
Collaborator

I will take care of these changes.

@SebastianSchuetze
Copy link
Collaborator Author

Just for the explanation. I created _applyTypesToWorkItemDeleted because the return JSON object is not consistent with a normal work item object. Strange enough, even the property names are different.
for example, the name of the work item when you query it is "title". But the object returned from the API when you delete it has the property named "name" and not "title"

This is for several properties. So I thought a new method is needed because I also created a new format.

Unless you tell me, that this can be done differently, then I am happy to know how it can be done simpler.

@DarqueWarrior
Copy link
Collaborator

Can you think of a scenario where you are going to save the returned deleted item? In all the rest of the remove calls we don't return the object. I think to stay consistent I will just not return anything here either. I am almost done with all the changes. There is nothing for you to do at this point.

@DarqueWarrior DarqueWarrior mentioned this pull request Nov 7, 2019
4 tasks
@DarqueWarrior
Copy link
Collaborator

Changes merged into PR #217

@SebastianSchuetze SebastianSchuetze deleted the topic/RemoveWorkItemsByIds branch November 7, 2019 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants