Esempio n. 1
0
        public List <WorkItemDeleteReference> GetDeletedItems(string project)
        {
            VssConnection connection = new VssConnection(_uri, _credentials);
            WorkItemTrackingHttpClient     workItemTrackingHttpClient = connection.GetClient <WorkItemTrackingHttpClient>();
            List <WorkItemDeleteReference> results = workItemTrackingHttpClient.GetDeletedWorkItemsAsync(project).Result;

            return(results);
        }
Esempio n. 2
0
        public List <WorkItemDeleteReference> GetMultipledDeletedWorkItems()
        {
            int[] ids = _ids;

            VssConnection connection = Context.Connection;
            WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>();

            List <WorkItemDeleteReference> result = workItemTrackingClient.GetDeletedWorkItemsAsync(ids).Result;

            return(result);
        }
Esempio n. 3
0
        public List <WorkItemDeleteReference> GetDeletedWorkItems()
        {
            string project = ClientSampleHelpers.FindAnyProject(this.Context).Name;

            VssConnection connection = Context.Connection;
            WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>();

            List <WorkItemDeleteReference> results = workItemTrackingClient.GetDeletedWorkItemsAsync(project, null).Result;

            return(results);
        }
        public void PermenentlyDeleteMultipleWorkItems()
        {
            int[] ids = { 72, 73, 81 }; //TODO

            VssConnection connection = Context.Connection;
            WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>();

            List <WorkItemDeleteReference> result = workItemTrackingClient.GetDeletedWorkItemsAsync(ids).Result;

            foreach (var item in result)
            {
                workItemTrackingClient.DestroyWorkItemAsync(Convert.ToInt32(item.Id));
            }
        }
Esempio n. 5
0
        public void RestoreMultipleWorkItems()
        {
            int[] ids = _ids;

            VssConnection connection = Context.Connection;
            WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>();

            List <WorkItemDeleteReference> result = workItemTrackingClient.GetDeletedWorkItemsAsync(ids).Result;

            WorkItemDeleteUpdate updateParameters = new WorkItemDeleteUpdate()
            {
                IsDeleted = false
            };

            foreach (var item in result)
            {
                var restore = workItemTrackingClient.RestoreWorkItemAsync(updateParameters, Convert.ToInt32(item.Id)).Result;
            }
        }