ADO System Parent

This commit is contained in:
2024-09-11 12:25:44 -07:00
parent ece70e7fd8
commit 45502a30a9
9 changed files with 27 additions and 31 deletions

View File

@ -170,7 +170,7 @@ public class FileRead : Shared.FileRead, IFileRead
string file; string file;
int i = 100000; int i = 100000;
JsonElement[] jsonElements; JsonElement[] jsonElements;
Task<HttpResponseMessage> httpResponseMessageTask = httpClient.GetAsync(string.Concat(basePage, api, $"/workitems?ids={ids}")); Task<HttpResponseMessage> httpResponseMessageTask = httpClient.GetAsync(string.Concat(basePage, api, $"/workitems?ids={ids}&$expand=Relations"));
httpResponseMessageTask.Wait(); httpResponseMessageTask.Wait();
if (!httpResponseMessageTask.Result.IsSuccessStatusCode) if (!httpResponseMessageTask.Result.IsSuccessStatusCode)
throw new Exception(httpResponseMessageTask.Result.StatusCode.ToString()); throw new Exception(httpResponseMessageTask.Result.StatusCode.ToString());

View File

@ -158,7 +158,9 @@ public class FileRead : Shared.FileRead, IFileRead
fields.MicrosoftVSTSSchedulingEffort == 0 ? null : fields.MicrosoftVSTSSchedulingEffort, fields.MicrosoftVSTSSchedulingEffort == 0 ? null : fields.MicrosoftVSTSSchedulingEffort,
value.Id, value.Id,
fields.SystemIterationPath, fields.SystemIterationPath,
fields.SystemParent == 0 ? null : fields.SystemParent,
fields.MicrosoftVSTSCommonPriority == 0 ? null : fields.MicrosoftVSTSCommonPriority, fields.MicrosoftVSTSCommonPriority == 0 ? null : fields.MicrosoftVSTSCommonPriority,
value.Relations,
fields.CustomRequester?.DisplayName, fields.CustomRequester?.DisplayName,
fields.MicrosoftVSTSCommonResolvedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonResolvedDate, fields.MicrosoftVSTSCommonResolvedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonResolvedDate,
value.Rev, value.Rev,

View File

@ -153,7 +153,7 @@ function initIndex(url) {
{ name: "Sorting", type: "local" }, { name: "Sorting", type: "local" },
{ name: "Filtering", type: "local" }, { name: "Filtering", type: "local" },
{ name: "Selection", mode: "row", multipleSelection: false, rowSelectionChanging: detailSelectionChangedRunInfo }, { 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 },
], ],
}); });
}); });

View File

@ -153,7 +153,7 @@ function initIndex(url) {
{ name: "Sorting", type: "local" }, { name: "Sorting", type: "local" },
{ name: "Filtering", type: "local" }, { name: "Filtering", type: "local" },
{ name: "Selection", mode: "row", multipleSelection: false, rowSelectionChanging: detailSelectionChangedRunInfo }, { 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 },
], ],
}); });
}); });

View File

@ -12,14 +12,15 @@ public class Fields
public Fields(int customRRminusOE, public Fields(int customRRminusOE,
CustomRequester? customRequester, CustomRequester? customRequester,
float customWSJF, float customWSJF,
float? microsoftVSTSSchedulingEffort,
int microsoftVSTSCommonBusinessValue, int microsoftVSTSCommonBusinessValue,
DateTime microsoftVSTSCommonClosedDate, DateTime microsoftVSTSCommonClosedDate,
int microsoftVSTSCommonPriority, int microsoftVSTSCommonPriority,
DateTime microsoftVSTSCommonResolvedDate, DateTime microsoftVSTSCommonResolvedDate,
DateTime microsoftVSTSCommonStateChangeDate, DateTime microsoftVSTSCommonStateChangeDate,
float microsoftVSTSCommonTimeCriticality, float microsoftVSTSCommonTimeCriticality,
float? microsoftVSTSSchedulingEffort,
DateTime microsoftVSTSSchedulingStartDate, DateTime microsoftVSTSSchedulingStartDate,
DateTime microsoftVSTSSchedulingTargetDate,
string systemAreaPath, string systemAreaPath,
SystemAssignedTo systemAssignedTo, SystemAssignedTo systemAssignedTo,
SystemChangedBy systemChangedBy, SystemChangedBy systemChangedBy,
@ -30,25 +31,26 @@ public class Fields
string systemDescription, string systemDescription,
string systemHistory, string systemHistory,
string systemIterationPath, string systemIterationPath,
int systemParent,
string systemReason, string systemReason,
string systemState, string systemState,
string systemTags, string systemTags,
string systemTeamProject, string systemTeamProject,
string systemTitle, string systemTitle,
string systemWorkItemType, string systemWorkItemType)
DateTime microsoftVSTSSchedulingTargetDate)
{ {
CustomRRminusOE = customRRminusOE;
CustomRequester = customRequester; CustomRequester = customRequester;
CustomRRminusOE = customRRminusOE;
CustomWSJF = customWSJF; CustomWSJF = customWSJF;
MicrosoftVSTSSchedulingEffort = microsoftVSTSSchedulingEffort;
MicrosoftVSTSCommonBusinessValue = microsoftVSTSCommonBusinessValue; MicrosoftVSTSCommonBusinessValue = microsoftVSTSCommonBusinessValue;
MicrosoftVSTSCommonClosedDate = microsoftVSTSCommonClosedDate; MicrosoftVSTSCommonClosedDate = microsoftVSTSCommonClosedDate;
MicrosoftVSTSCommonPriority = microsoftVSTSCommonPriority; MicrosoftVSTSCommonPriority = microsoftVSTSCommonPriority;
MicrosoftVSTSCommonResolvedDate = microsoftVSTSCommonResolvedDate; MicrosoftVSTSCommonResolvedDate = microsoftVSTSCommonResolvedDate;
MicrosoftVSTSCommonStateChangeDate = microsoftVSTSCommonStateChangeDate; MicrosoftVSTSCommonStateChangeDate = microsoftVSTSCommonStateChangeDate;
MicrosoftVSTSCommonTimeCriticality = microsoftVSTSCommonTimeCriticality; MicrosoftVSTSCommonTimeCriticality = microsoftVSTSCommonTimeCriticality;
MicrosoftVSTSSchedulingEffort = microsoftVSTSSchedulingEffort;
MicrosoftVSTSSchedulingStartDate = microsoftVSTSSchedulingStartDate; MicrosoftVSTSSchedulingStartDate = microsoftVSTSSchedulingStartDate;
MicrosoftVSTSSchedulingTargetDate = microsoftVSTSSchedulingTargetDate;
SystemAreaPath = systemAreaPath; SystemAreaPath = systemAreaPath;
SystemAssignedTo = systemAssignedTo; SystemAssignedTo = systemAssignedTo;
SystemChangedBy = systemChangedBy; SystemChangedBy = systemChangedBy;
@ -59,17 +61,17 @@ public class Fields
SystemDescription = systemDescription; SystemDescription = systemDescription;
SystemHistory = systemHistory; SystemHistory = systemHistory;
SystemIterationPath = systemIterationPath; SystemIterationPath = systemIterationPath;
SystemParent = systemParent;
SystemReason = systemReason; SystemReason = systemReason;
SystemState = systemState; SystemState = systemState;
SystemTags = systemTags; SystemTags = systemTags;
SystemTeamProject = systemTeamProject; SystemTeamProject = systemTeamProject;
SystemTitle = systemTitle; SystemTitle = systemTitle;
SystemWorkItemType = systemWorkItemType; SystemWorkItemType = systemWorkItemType;
MicrosoftVSTSSchedulingTargetDate = microsoftVSTSSchedulingTargetDate;
} }
[JsonPropertyName("Custom.RRminusOE")] public int CustomRRminusOE { get; } // { init; get; }
[JsonPropertyName("Custom.Requester")] public CustomRequester? CustomRequester { 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("Custom.WSJF")] public float CustomWSJF { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.BusinessValue")] public int MicrosoftVSTSCommonBusinessValue { 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; } [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.Common.TimeCriticality")] public float MicrosoftVSTSCommonTimeCriticality { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Scheduling.Effort")] public float? MicrosoftVSTSSchedulingEffort { 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.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.AreaPath")] public string SystemAreaPath { get; } // { init; get; }
[JsonPropertyName("System.AssignedTo")] public SystemAssignedTo? SystemAssignedTo { get; } // { init; get; } [JsonPropertyName("System.AssignedTo")] public SystemAssignedTo? SystemAssignedTo { get; } // { init; get; }
[JsonPropertyName("System.ChangedBy")] public SystemChangedBy SystemChangedBy { 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.Description")] public string SystemDescription { get; } // { init; get; }
[JsonPropertyName("System.History")] public string SystemHistory { get; } // { init; get; } [JsonPropertyName("System.History")] public string SystemHistory { get; } // { init; get; }
[JsonPropertyName("System.IterationPath")] public string SystemIterationPath { 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.Reason")] public string SystemReason { get; } // { init; get; }
[JsonPropertyName("System.State")] public string SystemState { get; } // { init; get; } [JsonPropertyName("System.State")] public string SystemState { get; } // { init; get; }
[JsonPropertyName("System.Tags")] public string SystemTags { get; } // { init; get; } [JsonPropertyName("System.Tags")] public string SystemTags { get; } // { init; get; }
[JsonPropertyName("System.TeamProject")] public string SystemTeamProject { get; } // { init; get; } [JsonPropertyName("System.TeamProject")] public string SystemTeamProject { get; } // { init; get; }
[JsonPropertyName("System.Title")] public string SystemTitle { get; } // { init; get; } [JsonPropertyName("System.Title")] public string SystemTitle { get; } // { init; get; }
[JsonPropertyName("System.WorkItemType")] public string SystemWorkItemType { get; } // { init; get; } [JsonPropertyName("System.WorkItemType")] public string SystemWorkItemType { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Scheduling.TargetDate")] public DateTime MicrosoftVSTSSchedulingTargetDate { get; } // { init; get; }
} }

View File

@ -9,6 +9,7 @@ public class Value
int id, int id,
int rev, int rev,
Fields fields, Fields fields,
object[] relations,
CommentVersionRef commentVersionRef, CommentVersionRef commentVersionRef,
string url string url
) )
@ -16,6 +17,7 @@ public class Value
Id = id; Id = id;
Rev = rev; Rev = rev;
Fields = fields; Fields = fields;
Relations = relations;
CommentVersionRef = commentVersionRef; CommentVersionRef = commentVersionRef;
Url = url; Url = url;
} }
@ -29,6 +31,9 @@ public class Value
[JsonPropertyName("fields")] [JsonPropertyName("fields")]
public Fields Fields { get; } public Fields Fields { get; }
[JsonPropertyName("relations")]
public object[] Relations { get; }
[JsonPropertyName("commentVersionRef")] [JsonPropertyName("commentVersionRef")]
public CommentVersionRef CommentVersionRef { get; } public CommentVersionRef CommentVersionRef { get; }

View File

@ -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; }
}

View File

@ -20,7 +20,9 @@ public class WorkItem
float? effort, float? effort,
int id, int id,
string iterationPath, string iterationPath,
int? parent,
int? priority, int? priority,
object[]? relations,
string? requester, string? requester,
DateTime? resolvedDate, DateTime? resolvedDate,
int revision, int revision,
@ -45,7 +47,9 @@ public class WorkItem
Effort = effort; Effort = effort;
Id = id; Id = id;
IterationPath = iterationPath; IterationPath = iterationPath;
Parent = parent;
Priority = priority; Priority = priority;
Relations = relations;
Requester = requester; Requester = requester;
ResolvedDate = resolvedDate; ResolvedDate = resolvedDate;
Revision = revision; Revision = revision;
@ -71,7 +75,9 @@ public class WorkItem
public float? Effort { get; set; } // { init; get; } public float? Effort { get; set; } // { init; get; }
public int Id { get; set; } // { init; get; } public int Id { get; set; } // { init; get; }
public string IterationPath { 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 int? Priority { get; set; } // { init; get; }
public object[]? Relations { get; set; } // { init; get; }
public string? Requester { get; set; } // { init; get; } public string? Requester { get; set; } // { init; get; }
public DateTime? ResolvedDate { get; set; } // { init; get; } public DateTime? ResolvedDate { get; set; } // { init; get; }
public int Revision { get; set; } // { init; get; } public int Revision { get; set; } // { init; get; }

View File

@ -132,7 +132,6 @@
<Compile Include="Adaptation\FileHandlers\json\WorkItems\SystemChangedBy.cs" /> <Compile Include="Adaptation\FileHandlers\json\WorkItems\SystemChangedBy.cs" />
<Compile Include="Adaptation\FileHandlers\json\WorkItems\SystemCreatedBy.cs" /> <Compile Include="Adaptation\FileHandlers\json\WorkItems\SystemCreatedBy.cs" />
<Compile Include="Adaptation\FileHandlers\json\WorkItems\Value.cs" /> <Compile Include="Adaptation\FileHandlers\json\WorkItems\Value.cs" />
<Compile Include="Adaptation\FileHandlers\json\WorkItems\ValueWithReq.cs" />
<Compile Include="Adaptation\FileHandlers\json\WorkItems\WorkItem.cs" /> <Compile Include="Adaptation\FileHandlers\json\WorkItems\WorkItem.cs" />
<Compile Include="Adaptation\FileHandlers\Kanban\FileRead.cs" /> <Compile Include="Adaptation\FileHandlers\Kanban\FileRead.cs" />
<Compile Include="Adaptation\FileHandlers\MoveMatchingFiles\FileRead.cs" /> <Compile Include="Adaptation\FileHandlers\MoveMatchingFiles\FileRead.cs" />