Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions src/ADOGenerator/Services/ProjectService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ADOGenerator.IServices;
using ADOGenerator.IServices;
using ADOGenerator.Models;
using Microsoft.Extensions.Configuration;
using Microsoft.VisualStudio.Services.Common;
Expand Down Expand Up @@ -551,26 +551,21 @@ public bool CreateProjectEnvironment(Project model)
#region work items
Dictionary<string, string> workItems = new();
string _WitPath = GetJsonFilePath(model.IsPrivatePath, model.PrivateTemplatePath, templateUsed, "WorkItems");
//Path.Combine(templatesFolder + templateUsed + "\\WorkItems");
if (Directory.Exists(_WitPath))
{
string[] workItemFilePaths = Directory.GetFiles(_WitPath);
if (workItemFilePaths.Length > 0)
{
foreach (var workItem in workItemFilePaths)
{
string[] workItemPatSplit = workItem.Split('\\');
if (workItemPatSplit.Length > 0)
string workItemName = Path.GetFileName(workItem); // Use Path.GetFileName for cross-platform compatibility
if (!string.IsNullOrEmpty(workItemName))
{
string workItemName = workItemPatSplit[workItemPatSplit.Length - 1];
if (!string.IsNullOrEmpty(workItemName))
string[] nameExtension = workItemName.Split('.');
string name = nameExtension[0];
if (!workItems.ContainsKey(name))
{
string[] nameExtension = workItemName.Split('.');
string name = nameExtension[0];
if (!workItems.ContainsKey(name))
{
workItems.Add(name, model.ReadJsonFile(workItem));
}
workItems.Add(name, model.ReadJsonFile(workItem));
}
}
}
Expand All @@ -581,7 +576,6 @@ public bool CreateProjectEnvironment(Project model)
if (File.Exists(projectSettingsFile))
{
string attchmentFilesFolder = GetJsonFilePath(model.IsPrivatePath, model.PrivateTemplatePath, templateUsed, "WorkItemAttachments");
//string.Format(templatesFolder + @"{0}\WorkItemAttachments", templateUsed);
if (listPullRequestJsonPaths.Count > 0)
{
if (templateUsed == "MyHealthClinic")
Expand All @@ -603,7 +597,6 @@ public bool CreateProjectEnvironment(Project model)
}
model.id.AddMessage("Work Items created");
}

#endregion

//Creat TestPlans and TestSuites
Expand Down
Loading