From 45502a30a98f11d75aa7a30d620b28ea8b8d17b2 Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Wed, 11 Sep 2024 12:25:44 -0700 Subject: [PATCH] ADO System Parent --- .../DownloadWorkItems/FileRead.cs | 2 +- Adaptation/FileHandlers/json/FileRead.cs | 2 ++ .../FileHandlers/json/StaticSite/js/leo.js | 2 +- .../FileHandlers/json/StaticSite/js/mes.js | 2 +- .../FileHandlers/json/WorkItems/Fields.cs | 19 +++++++++++-------- .../FileHandlers/json/WorkItems/Value.cs | 5 +++++ .../json/WorkItems/ValueWithReq.cs | 19 ------------------- .../FileHandlers/json/WorkItems/WorkItem.cs | 6 ++++++ MESAFIBACKLOG.csproj | 1 - 9 files changed, 27 insertions(+), 31 deletions(-) diff --git a/Adaptation/FileHandlers/DownloadWorkItems/FileRead.cs b/Adaptation/FileHandlers/DownloadWorkItems/FileRead.cs index b79e85c..fdb9b4a 100644 --- a/Adaptation/FileHandlers/DownloadWorkItems/FileRead.cs +++ b/Adaptation/FileHandlers/DownloadWorkItems/FileRead.cs @@ -170,7 +170,7 @@ public class FileRead : Shared.FileRead, IFileRead string file; int i = 100000; JsonElement[] jsonElements; - Task httpResponseMessageTask = httpClient.GetAsync(string.Concat(basePage, api, $"/workitems?ids={ids}")); + Task httpResponseMessageTask = httpClient.GetAsync(string.Concat(basePage, api, $"/workitems?ids={ids}&$expand=Relations")); httpResponseMessageTask.Wait(); if (!httpResponseMessageTask.Result.IsSuccessStatusCode) throw new Exception(httpResponseMessageTask.Result.StatusCode.ToString()); diff --git a/Adaptation/FileHandlers/json/FileRead.cs b/Adaptation/FileHandlers/json/FileRead.cs index 18c6fee..8fc2383 100644 --- a/Adaptation/FileHandlers/json/FileRead.cs +++ b/Adaptation/FileHandlers/json/FileRead.cs @@ -158,7 +158,9 @@ public class FileRead : Shared.FileRead, IFileRead fields.MicrosoftVSTSSchedulingEffort == 0 ? null : fields.MicrosoftVSTSSchedulingEffort, value.Id, fields.SystemIterationPath, + fields.SystemParent == 0 ? null : fields.SystemParent, fields.MicrosoftVSTSCommonPriority == 0 ? null : fields.MicrosoftVSTSCommonPriority, + value.Relations, fields.CustomRequester?.DisplayName, fields.MicrosoftVSTSCommonResolvedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonResolvedDate, value.Rev, diff --git a/Adaptation/FileHandlers/json/StaticSite/js/leo.js b/Adaptation/FileHandlers/json/StaticSite/js/leo.js index 4faf6a2..ca62889 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/leo.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/leo.js @@ -153,7 +153,7 @@ function initIndex(url) { { name: "Sorting", type: "local" }, { name: "Filtering", type: "local" }, { name: "Selection", mode: "row", multipleSelection: false, rowSelectionChanging: detailSelectionChangedRunInfo }, - { name: "Paging", type: "local", recordCountKey: "TotalRows", pageSize: 10, pageSizeUrlKey: "pageSize", "pageIndexUrlKey": "page", showPageSizeDropDown: false }, + { name: "Paging", type: "local", recordCountKey: "TotalRows", pageSize: 10, pageSizeUrlKey: "pageSize", "pageIndexUrlKey": "page", showPageSizeDropDown: true }, ], }); }); diff --git a/Adaptation/FileHandlers/json/StaticSite/js/mes.js b/Adaptation/FileHandlers/json/StaticSite/js/mes.js index 69a0abf..5395107 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/mes.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/mes.js @@ -153,7 +153,7 @@ function initIndex(url) { { name: "Sorting", type: "local" }, { name: "Filtering", type: "local" }, { name: "Selection", mode: "row", multipleSelection: false, rowSelectionChanging: detailSelectionChangedRunInfo }, - { name: "Paging", type: "local", recordCountKey: "TotalRows", pageSize: 10, pageSizeUrlKey: "pageSize", "pageIndexUrlKey": "page", showPageSizeDropDown: false }, + { name: "Paging", type: "local", recordCountKey: "TotalRows", pageSize: 10, pageSizeUrlKey: "pageSize", "pageIndexUrlKey": "page", showPageSizeDropDown: true }, ], }); }); diff --git a/Adaptation/FileHandlers/json/WorkItems/Fields.cs b/Adaptation/FileHandlers/json/WorkItems/Fields.cs index 4437135..85c13b0 100644 --- a/Adaptation/FileHandlers/json/WorkItems/Fields.cs +++ b/Adaptation/FileHandlers/json/WorkItems/Fields.cs @@ -12,14 +12,15 @@ public class Fields public Fields(int customRRminusOE, CustomRequester? customRequester, float customWSJF, - float? microsoftVSTSSchedulingEffort, int microsoftVSTSCommonBusinessValue, DateTime microsoftVSTSCommonClosedDate, int microsoftVSTSCommonPriority, DateTime microsoftVSTSCommonResolvedDate, DateTime microsoftVSTSCommonStateChangeDate, float microsoftVSTSCommonTimeCriticality, + float? microsoftVSTSSchedulingEffort, DateTime microsoftVSTSSchedulingStartDate, + DateTime microsoftVSTSSchedulingTargetDate, string systemAreaPath, SystemAssignedTo systemAssignedTo, SystemChangedBy systemChangedBy, @@ -30,25 +31,26 @@ public class Fields string systemDescription, string systemHistory, string systemIterationPath, + int systemParent, string systemReason, string systemState, string systemTags, string systemTeamProject, string systemTitle, - string systemWorkItemType, - DateTime microsoftVSTSSchedulingTargetDate) + string systemWorkItemType) { - CustomRRminusOE = customRRminusOE; CustomRequester = customRequester; + CustomRRminusOE = customRRminusOE; CustomWSJF = customWSJF; - MicrosoftVSTSSchedulingEffort = microsoftVSTSSchedulingEffort; MicrosoftVSTSCommonBusinessValue = microsoftVSTSCommonBusinessValue; MicrosoftVSTSCommonClosedDate = microsoftVSTSCommonClosedDate; MicrosoftVSTSCommonPriority = microsoftVSTSCommonPriority; MicrosoftVSTSCommonResolvedDate = microsoftVSTSCommonResolvedDate; MicrosoftVSTSCommonStateChangeDate = microsoftVSTSCommonStateChangeDate; MicrosoftVSTSCommonTimeCriticality = microsoftVSTSCommonTimeCriticality; + MicrosoftVSTSSchedulingEffort = microsoftVSTSSchedulingEffort; MicrosoftVSTSSchedulingStartDate = microsoftVSTSSchedulingStartDate; + MicrosoftVSTSSchedulingTargetDate = microsoftVSTSSchedulingTargetDate; SystemAreaPath = systemAreaPath; SystemAssignedTo = systemAssignedTo; SystemChangedBy = systemChangedBy; @@ -59,17 +61,17 @@ public class Fields SystemDescription = systemDescription; SystemHistory = systemHistory; SystemIterationPath = systemIterationPath; + SystemParent = systemParent; SystemReason = systemReason; SystemState = systemState; SystemTags = systemTags; SystemTeamProject = systemTeamProject; SystemTitle = systemTitle; SystemWorkItemType = systemWorkItemType; - MicrosoftVSTSSchedulingTargetDate = microsoftVSTSSchedulingTargetDate; } - [JsonPropertyName("Custom.RRminusOE")] public int CustomRRminusOE { get; } // { init; get; } [JsonPropertyName("Custom.Requester")] public CustomRequester? CustomRequester { get; } // { init; get; } + [JsonPropertyName("Custom.RRminusOE")] public int CustomRRminusOE { get; } // { init; get; } [JsonPropertyName("Custom.WSJF")] public float CustomWSJF { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Common.BusinessValue")] public int MicrosoftVSTSCommonBusinessValue { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Common.ClosedDate")] public DateTime MicrosoftVSTSCommonClosedDate { get; } // { init; get; } @@ -79,6 +81,7 @@ public class Fields [JsonPropertyName("Microsoft.VSTS.Common.TimeCriticality")] public float MicrosoftVSTSCommonTimeCriticality { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Scheduling.Effort")] public float? MicrosoftVSTSSchedulingEffort { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Scheduling.StartDate")] public DateTime MicrosoftVSTSSchedulingStartDate { get; } // { init; get; } + [JsonPropertyName("Microsoft.VSTS.Scheduling.TargetDate")] public DateTime MicrosoftVSTSSchedulingTargetDate { get; } // { init; get; } [JsonPropertyName("System.AreaPath")] public string SystemAreaPath { get; } // { init; get; } [JsonPropertyName("System.AssignedTo")] public SystemAssignedTo? SystemAssignedTo { get; } // { init; get; } [JsonPropertyName("System.ChangedBy")] public SystemChangedBy SystemChangedBy { get; } // { init; get; } @@ -89,12 +92,12 @@ public class Fields [JsonPropertyName("System.Description")] public string SystemDescription { get; } // { init; get; } [JsonPropertyName("System.History")] public string SystemHistory { get; } // { init; get; } [JsonPropertyName("System.IterationPath")] public string SystemIterationPath { get; } // { init; get; } + [JsonPropertyName("System.Parent")] public int SystemParent { get; } // { init; get; } [JsonPropertyName("System.Reason")] public string SystemReason { get; } // { init; get; } [JsonPropertyName("System.State")] public string SystemState { get; } // { init; get; } [JsonPropertyName("System.Tags")] public string SystemTags { get; } // { init; get; } [JsonPropertyName("System.TeamProject")] public string SystemTeamProject { get; } // { init; get; } [JsonPropertyName("System.Title")] public string SystemTitle { get; } // { init; get; } [JsonPropertyName("System.WorkItemType")] public string SystemWorkItemType { get; } // { init; get; } - [JsonPropertyName("Microsoft.VSTS.Scheduling.TargetDate")] public DateTime MicrosoftVSTSSchedulingTargetDate { get; } // { init; get; } } \ No newline at end of file diff --git a/Adaptation/FileHandlers/json/WorkItems/Value.cs b/Adaptation/FileHandlers/json/WorkItems/Value.cs index adcfc06..1fabff6 100644 --- a/Adaptation/FileHandlers/json/WorkItems/Value.cs +++ b/Adaptation/FileHandlers/json/WorkItems/Value.cs @@ -9,6 +9,7 @@ public class Value int id, int rev, Fields fields, + object[] relations, CommentVersionRef commentVersionRef, string url ) @@ -16,6 +17,7 @@ public class Value Id = id; Rev = rev; Fields = fields; + Relations = relations; CommentVersionRef = commentVersionRef; Url = url; } @@ -29,6 +31,9 @@ public class Value [JsonPropertyName("fields")] public Fields Fields { get; } + [JsonPropertyName("relations")] + public object[] Relations { get; } + [JsonPropertyName("commentVersionRef")] public CommentVersionRef CommentVersionRef { get; } diff --git a/Adaptation/FileHandlers/json/WorkItems/ValueWithReq.cs b/Adaptation/FileHandlers/json/WorkItems/ValueWithReq.cs index 8caf3b3..e69de29 100644 --- a/Adaptation/FileHandlers/json/WorkItems/ValueWithReq.cs +++ b/Adaptation/FileHandlers/json/WorkItems/ValueWithReq.cs @@ -1,19 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Adaptation.FileHandlers.json.WorkItems; - -public class ValueWithReq -{ - [JsonConstructor] - public ValueWithReq( - Value value, - int req - ) - { - Value = value; - Req = req; - } - - public Value Value { get; set; } // { init; get; } - public int Req { get; set; } // { init; get; } -} \ No newline at end of file diff --git a/Adaptation/FileHandlers/json/WorkItems/WorkItem.cs b/Adaptation/FileHandlers/json/WorkItems/WorkItem.cs index 98ba951..4154248 100644 --- a/Adaptation/FileHandlers/json/WorkItems/WorkItem.cs +++ b/Adaptation/FileHandlers/json/WorkItems/WorkItem.cs @@ -20,7 +20,9 @@ public class WorkItem float? effort, int id, string iterationPath, + int? parent, int? priority, + object[]? relations, string? requester, DateTime? resolvedDate, int revision, @@ -45,7 +47,9 @@ public class WorkItem Effort = effort; Id = id; IterationPath = iterationPath; + Parent = parent; Priority = priority; + Relations = relations; Requester = requester; ResolvedDate = resolvedDate; Revision = revision; @@ -71,7 +75,9 @@ public class WorkItem public float? Effort { get; set; } // { init; get; } public int Id { get; set; } // { init; get; } public string IterationPath { get; set; } // { init; get; } + public int? Parent { get; set; } // { init; get; } public int? Priority { get; set; } // { init; get; } + public object[]? Relations { get; set; } // { init; get; } public string? Requester { get; set; } // { init; get; } public DateTime? ResolvedDate { get; set; } // { init; get; } public int Revision { get; set; } // { init; get; } diff --git a/MESAFIBACKLOG.csproj b/MESAFIBACKLOG.csproj index 5d774ca..8ffe20d 100644 --- a/MESAFIBACKLOG.csproj +++ b/MESAFIBACKLOG.csproj @@ -132,7 +132,6 @@ -