Skip to content

Commit

Permalink
Fixed the bug that the title of the work item was incorrect.
Browse files Browse the repository at this point in the history
  • Loading branch information
womoney7 committed Apr 11, 2024
1 parent 9dc0d79 commit 1494324
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;

using Microsoft.Extensions.Logging;

using MigrationTools.Endpoints;
using MigrationTools.Enrichers;

Expand Down Expand Up @@ -40,12 +42,14 @@ protected override void InternalExecute()
EnsureConfigured();
ProcessorEnrichers.ProcessorExecutionBegin(this);
var nodeStructurOptions = new TfsNodeStructureOptions()
{
Enabled = true,
NodeBasePaths = _options.NodeBasePaths,
AreaMaps = _options.AreaMaps,
IterationMaps = _options.IterationMaps,
};
{
Enabled = true,
NodeBasePaths = _options.NodeBasePaths,
AreaMaps = _options.AreaMaps,
IterationMaps = _options.IterationMaps,
ShouldCreateMissingRevisionPaths = _options.ShouldCreateMissingRevisionPaths,
ReplicateAllExistingNodes = _options.ReplicateAllExistingNodes
};
_nodeStructureEnricher.Configure(nodeStructurOptions);
_nodeStructureEnricher.ProcessorExecutionBegin(null);
ProcessorEnrichers.ProcessorExecutionEnd(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;

using MigrationTools.Enrichers;

namespace MigrationTools.Processors
Expand All @@ -11,6 +12,14 @@ public class TfsAreaAndIterationProcessorOptions : ProcessorOptions, ITfsNodeStr
public Dictionary<string, string> AreaMaps { get; set; }
public Dictionary<string, string> IterationMaps { get; set; }


/// <summary>
/// When set to True the susyem will try to create any missing missing area or iteration paths from the revisions.
/// </summary>
public bool ShouldCreateMissingRevisionPaths { get; set; }

public bool ReplicateAllExistingNodes { get; set; }

public override Type ToConfigure => typeof(TfsAreaAndIterationProcessor);

public override IProcessorOptions GetDefault()
Expand Down
1 change: 1 addition & 0 deletions src/MigrationTools/MigrationTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Copyright>naked Agility with Martin Hinshelwood 2016-2021</Copyright>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>15.0.1</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ private WorkItemData CreateWorkItem_Shell(ProjectData destProject, WorkItemData
newwit.Fields["System.CreatedDate"].Value = currentRevisionWorkItem.ToWorkItem().Revisions[0].Fields["System.CreatedDate"].Value;
workItemLog.Debug("Setting 'System.CreatedDate'={SystemCreatedDate}", currentRevisionWorkItem.ToWorkItem().Revisions[0].Fields["System.CreatedDate"].Value);
}

newwit.Title = currentRevisionWorkItem?.Title;
newwit[CoreField.ChangedDate] = currentRevisionWorkItem?.ChangedDate;

return newwit.AsWorkItemData();
}

Expand Down Expand Up @@ -595,7 +599,7 @@ private async Task ProcessWorkItemAsync(WorkItemData sourceWorkItem, int retryLi
AddMetric("SyncRev", processWorkItemMetrics, revisionsToMigrate.Count);
}
}
AddParameter("TargetWorkItem", processWorkItemParamiters, targetWorkItem.ToWorkItem().Revisions.Count.ToString());
AddParameter("TargetWorkItem", processWorkItemParamiters, targetWorkItem.ToWorkItem().Revisions?.Count.ToString());

if (targetWorkItem != null && targetWorkItem.ToWorkItem().IsDirty)
{
Expand Down

0 comments on commit 1494324

Please sign in to comment.