Iteration Path
This commit is contained in:
parent
513e8ae4fc
commit
65e31b09cc
@ -271,19 +271,20 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetLine(List<char> spaces, WorkItem workItem, KeyValuePair<int, Record> keyValuePair, bool condensed) =>
|
private static string GetLine(List<char> spaces, WorkItem workItem, KeyValuePair<int, Record> keyValuePair, bool condensed, bool sprintOnly) =>
|
||||||
!condensed ? $"{new string(spaces.Skip(1).ToArray())}- {GetClosed(workItem)} {keyValuePair.Key} - {workItem.Title}" :
|
sprintOnly ? $"\t- [ ] {workItem.IterationPath}" :
|
||||||
$"{new string(spaces.Skip(1).ToArray())}- {GetClosed(workItem)} {keyValuePair.Key} - {workItem.Title} ~~~ {workItem.AssignedTo} - {workItem.IterationPath.Replace('\\', '-')} - {workItem.CreatedDate} --- {workItem.ClosedDate}";
|
condensed ? $"{new string(spaces.Skip(1).ToArray())}- {GetClosed(workItem)} {keyValuePair.Key} - {workItem.Title}" :
|
||||||
|
$"{new string(spaces.Skip(1).ToArray())}- {GetClosed(workItem)} {keyValuePair.Key} - {workItem.Title} ~~~ {workItem.AssignedTo} - {workItem.IterationPath.Replace('\\', '-')} - {workItem.CreatedDate} --- {workItem.ClosedDate}";
|
||||||
|
|
||||||
private static void AppendLines(List<char> spaces, List<string> lines, Record record, bool condensed)
|
private static void AppendLines(List<char> spaces, List<string> lines, Record record, bool condensed, bool sprintOnly)
|
||||||
{
|
{
|
||||||
spaces.Add('\t');
|
spaces.Add('\t');
|
||||||
WorkItem workItem;
|
WorkItem workItem;
|
||||||
foreach (KeyValuePair<int, Record> keyValuePair in record.Children)
|
foreach (KeyValuePair<int, Record> keyValuePair in record.Children)
|
||||||
{
|
{
|
||||||
workItem = keyValuePair.Value.WorkItem;
|
workItem = keyValuePair.Value.WorkItem;
|
||||||
lines.Add(GetLine(spaces, workItem, keyValuePair, condensed));
|
lines.Add(GetLine(spaces, workItem, keyValuePair, condensed, sprintOnly));
|
||||||
AppendLines(spaces, lines, keyValuePair.Value, condensed);
|
AppendLines(spaces, lines, keyValuePair.Value, condensed, sprintOnly);
|
||||||
}
|
}
|
||||||
spaces.RemoveAt(0);
|
spaces.RemoveAt(0);
|
||||||
}
|
}
|
||||||
@ -291,6 +292,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
private static void AppendLines(List<char> spaces, List<string> lines, ReadOnlyDictionary<int, Record> workItemAndChildren, string workItemType)
|
private static void AppendLines(List<char> spaces, List<string> lines, ReadOnlyDictionary<int, Record> workItemAndChildren, string workItemType)
|
||||||
{
|
{
|
||||||
WorkItem workItem;
|
WorkItem workItem;
|
||||||
|
List<string> distinct = new();
|
||||||
foreach (KeyValuePair<int, Record> keyValuePair in workItemAndChildren)
|
foreach (KeyValuePair<int, Record> keyValuePair in workItemAndChildren)
|
||||||
{
|
{
|
||||||
workItem = keyValuePair.Value.WorkItem;
|
workItem = keyValuePair.Value.WorkItem;
|
||||||
@ -302,11 +304,20 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
lines.Add(string.Empty);
|
lines.Add(string.Empty);
|
||||||
if (keyValuePair.Value.Children.Count > 0)
|
if (keyValuePair.Value.Children.Count > 0)
|
||||||
{
|
{
|
||||||
AppendLines(spaces, lines, keyValuePair.Value, condensed: true);
|
AppendLines(spaces, lines, keyValuePair.Value, condensed: true, sprintOnly: false);
|
||||||
|
lines.Add(string.Empty);
|
||||||
|
distinct.Clear();
|
||||||
|
lines.Add($"## Distinct Iteration Path(s) - {workItem.WorkItemType} - {workItem.AssignedTo} - {workItem.Id} - {workItem.Title} - {workItem.IterationPath}");
|
||||||
|
lines.Add(string.Empty);
|
||||||
|
lines.Add($"- [{workItem.Id}](https://tfs.intra.infineon.com/tfs/FactoryIntegration/ART%20SPS/_workitems/edit/{workItem.Id})");
|
||||||
|
lines.Add(string.Empty);
|
||||||
|
AppendLines(spaces, distinct, keyValuePair.Value, condensed: false, sprintOnly: true);
|
||||||
|
distinct.Sort();
|
||||||
|
lines.AddRange(distinct.Distinct());
|
||||||
lines.Add(string.Empty);
|
lines.Add(string.Empty);
|
||||||
lines.Add($"## Extended - {workItem.Id} - {workItem.Title}");
|
lines.Add($"## Extended - {workItem.Id} - {workItem.Title}");
|
||||||
lines.Add(string.Empty);
|
lines.Add(string.Empty);
|
||||||
AppendLines(spaces, lines, keyValuePair.Value, condensed: false);
|
AppendLines(spaces, lines, keyValuePair.Value, condensed: false, sprintOnly: false);
|
||||||
lines.Add(string.Empty);
|
lines.Add(string.Empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user