diff --git a/Adaptation/FileHandlers/Markdown/ProcessData.cs b/Adaptation/FileHandlers/Markdown/ProcessData.cs index 9c9a5b0..829b804 100644 --- a/Adaptation/FileHandlers/Markdown/ProcessData.cs +++ b/Adaptation/FileHandlers/Markdown/ProcessData.cs @@ -84,6 +84,7 @@ public class ProcessData : IProcessData ReadOnlyCollection results; ReadOnlyDictionary keyValuePairs = GetWorkItems(workItems, keepRelations); ReadOnlyCollection records = new(keyValuePairs.Values.ToArray()); + ReadOnlyCollection userStoryWorkItemTypes = new(new string[] { "User Story" }); ReadOnlyCollection bugFeatureWorkItemTypes = new(new string[] { "Bug", "Feature" }); ReadOnlyCollection bugUserStoryWorkItemTypes = new(new string[] { "Bug", "User Story" }); ReadOnlyCollection bugUserStoryTaskWorkItemTypes = new(new string[] { "Bug", "User Story", "Task" }); @@ -154,6 +155,15 @@ public class ProcessData : IProcessData WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, "check-122517"); _Details.Add(results); } + { + lines.Clear(); + string workItemType = "User Story"; + lines.Add($"# {nameof(UserStoryCheckIterationPath228385)}"); + lines.Add(string.Empty); + results = UserStoryCheckIterationPath228385(url, lines, userStoryWorkItemTypes, keyValuePairs, workItemType); + WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, "check-228385"); + _Details.Add(results); + } if (messages.Count > 0) throw new Exception($"{messages.Count}{Environment.NewLine}{string.Join(Environment.NewLine, messages)}"); } @@ -758,4 +768,71 @@ public class ProcessData : IProcessData return new(results); } + private static ReadOnlyDictionary> GetWorkItemsMatching228385(ReadOnlyCollection records) + { + Dictionary> results = new(); + string key; + List? collection; + foreach (Record record in records) + { + key = $"{record.WorkItem.IterationPath}-{record.WorkItem.AssignedTo}"; + if (!results.TryGetValue(key, out collection)) + { + results.Add(key, new()); + if (!results.TryGetValue(key, out collection)) + throw new Exception(); + } + collection.Add(record); + } + return new(results); + } + + private static ReadOnlyDictionary> GetWorkItemsMatching228385(ReadOnlyDictionary keyValuePairs, string workItemType) + { + ReadOnlyDictionary> results; + Record record; + List records = new(); + foreach (KeyValuePair keyValuePair in keyValuePairs) + { + record = keyValuePair.Value; + if (record.WorkItem.State is "Removed" or "Closed") + continue; + if (!record.WorkItem.IterationPath.Contains('\\')) + continue; + if (record.WorkItem.StoryPoints is null) + continue; + if (record.WorkItem.WorkItemType != workItemType) + continue; + records.Add(record); + } + Record[] sorted = records.OrderByDescending(l => l.WorkItem.IterationPath).ToArray(); + results = GetWorkItemsMatching228385(new(sorted)); + return results; + } + + private static ReadOnlyCollection UserStoryCheckIterationPath228385(string url, List lines, ReadOnlyCollection _, ReadOnlyDictionary keyValuePairs, string workItemType) + { + List results = new(); + long totalStoryPoints; + ReadOnlyDictionary> records = GetWorkItemsMatching228385(keyValuePairs, workItemType); + foreach (KeyValuePair> keyValuePair in records) + { + totalStoryPoints = 0; + foreach (Record record in keyValuePair.Value) + { + if (record.WorkItem.StoryPoints is null) + continue; + totalStoryPoints += record.WorkItem.StoryPoints.Value; + } + lines.Add($"## {keyValuePair.Key} => {totalStoryPoints}"); + lines.Add(string.Empty); + foreach (Record record in keyValuePair.Value) + { + lines.Add($"- [ ] [{record.WorkItem.Id}]({url}{record.WorkItem.Id}) - {record.WorkItem.Title}"); + lines.Add(string.Empty); + } + } + return new(results); + } + } \ No newline at end of file diff --git a/Adaptation/FileHandlers/json/StaticSite/html/business.html b/Adaptation/FileHandlers/json/StaticSite/html/business.html index 9f1fc90..4b79abc 100644 --- a/Adaptation/FileHandlers/json/StaticSite/html/business.html +++ b/Adaptation/FileHandlers/json/StaticSite/html/business.html @@ -59,7 +59,7 @@ What is the relative value to the Customer or business? diff --git a/Adaptation/FileHandlers/json/StaticSite/html/cod-b.html b/Adaptation/FileHandlers/json/StaticSite/html/cod-b.html index e867c58..a4d4e3d 100644 --- a/Adaptation/FileHandlers/json/StaticSite/html/cod-b.html +++ b/Adaptation/FileHandlers/json/StaticSite/html/cod-b.html @@ -59,7 +59,7 @@ const fromHtml = true; const signalRUrl = "/signalr"; const windowLocationHRef = window.location.href; - const apiUrl = "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/"; + const apiUrl = "https://eaf-dev.mes.infineon.com/api/v1/ado/"; const workItems = { a: "/markdown/bugs-features-with-parents.json?v=2025-01-22-10-49", b: "/markdown/{[]}.json?v=2025-01-22-10-49" diff --git a/Adaptation/FileHandlers/json/StaticSite/html/cod.html b/Adaptation/FileHandlers/json/StaticSite/html/cod.html index 317ebd2..5b01339 100644 --- a/Adaptation/FileHandlers/json/StaticSite/html/cod.html +++ b/Adaptation/FileHandlers/json/StaticSite/html/cod.html @@ -88,7 +88,7 @@ th: "Cost of Delay (CoD)", span: "Cost of Delay (CoD) is the money lost by delaying or not doing a job for a specific time. It's a measure of the economic value of a job over time." }; - initIndex(fromHtml, windowLocationHRef, headerGrid, workItems, b, r, t, c, "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/"); + initIndex(fromHtml, windowLocationHRef, headerGrid, workItems, b, r, t, c, "https://eaf-dev.mes.infineon.com/api/v1/ado/"); }); diff --git a/Adaptation/FileHandlers/json/StaticSite/html/effort.html b/Adaptation/FileHandlers/json/StaticSite/html/effort.html index 1fe694f..46c4979 100644 --- a/Adaptation/FileHandlers/json/StaticSite/html/effort.html +++ b/Adaptation/FileHandlers/json/StaticSite/html/effort.html @@ -55,7 +55,7 @@ diff --git a/Adaptation/FileHandlers/json/StaticSite/html/risk.html b/Adaptation/FileHandlers/json/StaticSite/html/risk.html index 35818a1..b886a46 100644 --- a/Adaptation/FileHandlers/json/StaticSite/html/risk.html +++ b/Adaptation/FileHandlers/json/StaticSite/html/risk.html @@ -59,7 +59,7 @@ What else does this do for our business? diff --git a/Adaptation/FileHandlers/json/StaticSite/html/time.html b/Adaptation/FileHandlers/json/StaticSite/html/time.html index 504b3a0..3a457ae 100644 --- a/Adaptation/FileHandlers/json/StaticSite/html/time.html +++ b/Adaptation/FileHandlers/json/StaticSite/html/time.html @@ -59,7 +59,7 @@ How does user/business value decay over time? diff --git a/Adaptation/FileHandlers/json/StaticSite/html/wsjf-b.html b/Adaptation/FileHandlers/json/StaticSite/html/wsjf-b.html index d5df776..016c35c 100644 --- a/Adaptation/FileHandlers/json/StaticSite/html/wsjf-b.html +++ b/Adaptation/FileHandlers/json/StaticSite/html/wsjf-b.html @@ -55,7 +55,7 @@ diff --git a/Adaptation/FileHandlers/json/StaticSite/html/wsjf-c.html b/Adaptation/FileHandlers/json/StaticSite/html/wsjf-c.html index 339d5db..b0c307d 100644 --- a/Adaptation/FileHandlers/json/StaticSite/html/wsjf-c.html +++ b/Adaptation/FileHandlers/json/StaticSite/html/wsjf-c.html @@ -26,7 +26,7 @@ diff --git a/Adaptation/FileHandlers/json/StaticSite/html/wsjf.html b/Adaptation/FileHandlers/json/StaticSite/html/wsjf.html index 965d231..1066ade 100644 --- a/Adaptation/FileHandlers/json/StaticSite/html/wsjf.html +++ b/Adaptation/FileHandlers/json/StaticSite/html/wsjf.html @@ -55,7 +55,7 @@ diff --git a/Adaptation/FileHandlers/json/StaticSite/js/cod-b.js b/Adaptation/FileHandlers/json/StaticSite/js/cod-b.js index b296ff6..8df1e1c 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/cod-b.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/cod-b.js @@ -17058,7 +17058,7 @@ if (typeof document == 'undefined') { const machineId = ''; const fromHtml = false; const signalRUrl = "/signalr"; - const apiUrl = "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/"; + const apiUrl = "https://eaf-dev.mes.infineon.com/api/v1/ado/"; const windowLocationHRef = "https://eaf-dev.mes.infineon.com/html/cod.html?site=MES"; const workItems = { a: "https://eaf-dev.mes.infineon.com/markdown/bugs-features-with-parents.json?v=2025-01-22-10-49",