Skip to content

Commit a935f0f

Browse files
committed
Remove UpdateCreatedBy and UpdateCreatedDate options from TfsWorkItemMigrationProcessor and related schemas
1 parent 44e5a01 commit a935f0f

File tree

6 files changed

+4
-65
lines changed

6 files changed

+4
-65
lines changed

docs/data/classes/reference.processors.tfsworkitemmigrationprocessor.yaml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ configurationSamples:
5959
{
6060
"$type": "TfsWorkItemMigrationProcessorOptions",
6161
"Enabled": false,
62-
"UpdateCreatedDate": true,
63-
"UpdateCreatedBy": true,
6462
"WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc",
6563
"FixHtmlAttachmentLinks": true,
6664
"WorkItemCreateRetryLimit": 5,
@@ -161,24 +159,6 @@ options:
161159
defaultValue: missing XML code comments
162160
isRequired: true
163161
dotNetType: System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
164-
- parameterName: UpdateCreatedBy
165-
type: Boolean
166-
description: >-
167-
If this is enabled the creation process on the target project will create the items with the original creation date.
168-
(Important: The item history is always pointed to the date of the migration, it's change only the data column CreateDate,
169-
not the internal create date)
170-
defaultValue: true
171-
isRequired: false
172-
dotNetType: System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
173-
- parameterName: UpdateCreatedDate
174-
type: Boolean
175-
description: >-
176-
If this is enabled the creation process on the target project will create the items with the original creation date.
177-
(Important: The item history is always pointed to the date of the migration, it's change only the data column CreateDate,
178-
not the internal create date)
179-
defaultValue: true
180-
isRequired: false
181-
dotNetType: System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
182162
- parameterName: WIQLQuery
183163
type: String
184164
description: A work item query based on WIQL to select only important work items. To migrate all leave this empty. See [WIQL Query Bits](#wiql-query-bits)

docs/static/schema/configuration.schema.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,16 +1466,6 @@
14661466
"description": "This is the `IEndpoint` that will be used as the Target of the Migration. Can be null for a read only processor.",
14671467
"type": "string"
14681468
},
1469-
"UpdateCreatedBy": {
1470-
"description": "If this is enabled the creation process on the target project will create the items with the original creation date.\r\n (Important: The item history is always pointed to the date of the migration, it's change only the data column CreateDate,\r\n not the internal create date)",
1471-
"type": "boolean",
1472-
"default": "true"
1473-
},
1474-
"UpdateCreatedDate": {
1475-
"description": "If this is enabled the creation process on the target project will create the items with the original creation date.\r\n (Important: The item history is always pointed to the date of the migration, it's change only the data column CreateDate,\r\n not the internal create date)",
1476-
"type": "boolean",
1477-
"default": "true"
1478-
},
14791469
"WIQLQuery": {
14801470
"description": "A work item query based on WIQL to select only important work items. To migrate all leave this empty. See [WIQL Query Bits](#wiql-query-bits)",
14811471
"type": "string",

docs/static/schema/schema.processors.tfsworkitemmigrationprocessor.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@
6363
"description": "This is the `IEndpoint` that will be used as the Target of the Migration. Can be null for a read only processor.",
6464
"type": "string"
6565
},
66-
"UpdateCreatedBy": {
67-
"description": "If this is enabled the creation process on the target project will create the items with the original creation date.\r\n (Important: The item history is always pointed to the date of the migration, it's change only the data column CreateDate,\r\n not the internal create date)",
68-
"type": "boolean",
69-
"default": "true"
70-
},
71-
"UpdateCreatedDate": {
72-
"description": "If this is enabled the creation process on the target project will create the items with the original creation date.\r\n (Important: The item history is always pointed to the date of the migration, it's change only the data column CreateDate,\r\n not the internal create date)",
73-
"type": "boolean",
74-
"default": "true"
75-
},
7666
"WIQLQuery": {
7767
"description": "A work item query based on WIQL to select only important work items. To migrate all leave this empty. See [WIQL Query Bits](#wiql-query-bits)",
7868
"type": "string",

src/MigrationTools.Clients.TfsObjectModel/Endpoints/TfsEndpointOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ public enum TfsProductVersion
1919
/// <summary>
2020
/// Represents legacy Team Foundation Server versions prior to 2013. Not technically supported but may work.
2121
/// </summary>
22-
OnPremisesClassic,
22+
OnPremisesClassic = 0,
2323

2424
/// <summary>
2525
/// Represents on-premises Team Foundation Server 2013+ and Azure DevOps Server (default).
2626
/// </summary>
27-
OnPremises,
27+
OnPremises = 1,
2828

2929
/// <summary>
3030
/// Represents Azure DevOps Services (cloud version).
3131
/// </summary>
32-
Cloud
32+
Cloud = 2
3333
}
3434

3535
/// <summary>

src/MigrationTools.Clients.TfsObjectModel/Processors/TfsWorkItemMigrationProcessor.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,10 @@ private WorkItemData CreateWorkItem_Shell(ProjectData destProject, WorkItemData
369369
activity?.Stop();
370370
activity?.SetStatus(ActivityStatusCode.Ok);
371371
activity?.SetTag("http.response.status_code", "200");
372-
if (Options.UpdateCreatedBy)
372+
if (Target.Options.ProductVersion != Endpoints.TfsProductVersion.OnPremisesClassic)
373373
{
374374
newwit.Fields["System.CreatedBy"].Value = currentRevisionWorkItem.ToWorkItem().Revisions[0].Fields["System.CreatedBy"].Value;
375375
workItemLog.Debug("Setting 'System.CreatedBy'={SystemCreatedBy}", currentRevisionWorkItem.ToWorkItem().Revisions[0].Fields["System.CreatedBy"].Value);
376-
}
377-
if (Options.UpdateCreatedDate)
378-
{
379376
newwit.Fields["System.CreatedDate"].Value = currentRevisionWorkItem.ToWorkItem().Revisions[0].Fields["System.CreatedDate"].Value;
380377
workItemLog.Debug("Setting 'System.CreatedDate'={SystemCreatedDate}", currentRevisionWorkItem.ToWorkItem().Revisions[0].Fields["System.CreatedDate"].Value);
381378
}

src/MigrationTools.Clients.TfsObjectModel/Processors/TfsWorkItemMigrationProcessorOptions.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,6 @@ namespace MigrationTools.Processors
1111
/// </summary>
1212
public class TfsWorkItemMigrationProcessorOptions : ProcessorOptions, IWorkItemProcessorConfig
1313
{
14-
/// <summary>
15-
/// If this is enabled the creation process on the target project will create the items with the original creation date.
16-
/// (Important: The item history is always pointed to the date of the migration, it's change only the data column CreateDate,
17-
/// not the internal create date)
18-
/// </summary>
19-
/// <default>true</default>
20-
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
21-
public bool UpdateCreatedDate { get; set; } = true;
22-
23-
/// <summary>
24-
/// If this is enabled the creation process on the target project will create the items with the original creation date.
25-
/// (Important: The item history is always pointed to the date of the migration, it's change only the data column CreateDate,
26-
/// not the internal create date)
27-
/// </summary>
28-
/// <default>true</default>
29-
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
30-
public bool UpdateCreatedBy { get; set; } = true;
31-
3214
/// <summary>
3315
/// A work item query based on WIQL to select only important work items. To migrate all leave this empty. See [WIQL Query Bits](#wiql-query-bits)
3416
/// </summary>

0 commit comments

Comments
 (0)