Skip to content

Commit 2521e51

Browse files
authored
Merge branch 'main' into copilot/fix-2747
2 parents 7f5103b + 9f7ae56 commit 2521e51

File tree

7 files changed

+252
-622
lines changed

7 files changed

+252
-622
lines changed

appsettings.json

Lines changed: 126 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -192,118 +192,138 @@
192192
"FieldMappingTool": {
193193
"Enabled": true,
194194
"FieldMaps": [
195-
{
196-
"FieldMapType": "FieldMergeMap",
197-
"ApplyTo": [ "SomeWorkItemType" ],
198-
"sourceFields": [ "Custom.FieldA", "Custom.FieldB" ],
199-
"targetField": "Custom.FieldC",
200-
"formatExpression": "{0} \n {1}"
201-
},
202-
{
203-
"FieldMapType": "FieldValueMap",
204-
"ApplyTo": [ "SomeWorkItemType" ],
205-
"sourceField": "System.State",
206-
"targetField": "System.State",
207-
"defaultValue": "New",
208-
"valueMapping": {
209-
"Active": "InProgress",
210-
"Resolved": "InProgress",
211-
"Closed": "Done"
195+
{
196+
"FieldMapType": "FieldCalculationMap",
197+
"ApplyTo": [ "Bug", "Task" ],
198+
"expression": "[effort] * [rate]",
199+
"parameters": {
200+
"effort": "Custom.EstimatedHours",
201+
"rate": "Custom.HourlyRate"
202+
},
203+
"targetField": "Custom.EstimatedCost"
204+
},
205+
{
206+
"FieldMapType": "FieldMergeMap",
207+
"ApplyTo": [ "SomeWorkItemType" ],
208+
"sourceFields": [ "Custom.FieldA", "Custom.FieldB" ],
209+
"targetField": "Custom.FieldC",
210+
"formatExpression": "{0} \n {1}"
211+
},
212+
{
213+
"FieldMapType": "FieldValueMap",
214+
"ApplyTo": [ "SomeWorkItemType" ],
215+
"sourceField": "System.State",
216+
"targetField": "System.State",
217+
"defaultValue": "New",
218+
"valueMapping": {
219+
"Active": "InProgress",
220+
"Resolved": "InProgress",
221+
"Closed": "Done"
222+
}
223+
},
224+
{
225+
"FieldMapType": "FieldToFieldMap",
226+
"ApplyTo": [ "SomeWorkItemType" ],
227+
"sourceField": "Microsoft.VSTS.Common.BacklogPriority",
228+
"targetField": "Microsoft.VSTS.Common.StackRank",
229+
"defaultValue": 42
212230
}
213-
},
214-
{
215-
"FieldMapType": "FieldToFieldMap",
216-
"ApplyTo": [ "SomeWorkItemType" ],
217-
"sourceField": "Microsoft.VSTS.Common.BacklogPriority",
218-
"targetField": "Microsoft.VSTS.Common.StackRank",
219-
"defaultValue": 42
220-
}
221231
],
222232
"FieldMapSamples": {
223-
"FieldClearMap": {
224-
"ApplyTo": [ "SomeWorkItemType" ],
225-
"targetField": "Custom.FieldC"
226-
},
227-
"FieldMergeMap": {
228-
"ApplyTo": [ "SomeWorkItemType" ],
229-
"sourceFields": [ "Custom.FieldA", "Custom.FieldB" ],
230-
"targetField": "Custom.FieldC",
231-
"formatExpression": "{0} \n {1}"
232-
},
233-
"FieldLiteralMap": {
234-
"ApplyTo": [ "SomeWorkItemType" ],
235-
"targetField": "Custom.SomeField",
236-
"value": "New field value"
237-
},
238-
"MultiValueConditionalMap": {
239-
"ApplyTo": [ "SomeWorkItemType" ],
240-
"sourceFieldsAndValues": {
241-
"Field1": "Value1",
242-
"Field2": "Value2"
233+
"FieldCalculationMap": {
234+
"FieldMapType": "FieldCalculationMap",
235+
"ApplyTo": [ "Bug", "Task" ],
236+
"expression": "[effort] * [rate]",
237+
"parameters": {
238+
"effort": "Custom.EstimatedHours",
239+
"rate": "Custom.HourlyRate"
240+
},
241+
"targetField": "Custom.EstimatedCost"
242+
},
243+
"FieldClearMap": {
244+
"ApplyTo": [ "SomeWorkItemType" ],
245+
"targetField": "Custom.FieldC"
246+
},
247+
"FieldMergeMap": {
248+
"ApplyTo": [ "SomeWorkItemType" ],
249+
"sourceFields": [ "Custom.FieldA", "Custom.FieldB" ],
250+
"targetField": "Custom.FieldC",
251+
"formatExpression": "{0} \n {1}"
252+
},
253+
"FieldLiteralMap": {
254+
"ApplyTo": [ "SomeWorkItemType" ],
255+
"targetField": "Custom.SomeField",
256+
"value": "New field value"
257+
},
258+
"MultiValueConditionalMap": {
259+
"ApplyTo": [ "SomeWorkItemType" ],
260+
"sourceFieldsAndValues": {
261+
"Field1": "Value1",
262+
"Field2": "Value2"
263+
},
264+
"targetFieldsAndValues": {
265+
"Field1": "Value1",
266+
"Field2": "Value2"
267+
}
243268
},
244269
"targetFieldsAndValues": {
245-
"Field1": "Value1",
246-
"Field2": "Value2"
247-
}
248-
},
249-
"targetFieldsAndValues": {
250-
"ApplyTo": [ "SomeWorkItemType" ],
251-
"targetField": "Custom.ReflectedWorkItemId"
252-
},
253-
"FieldValueMap": {
254-
"ApplyTo": [ "SomeWorkItemType" ],
255-
"sourceField": "System.State",
256-
"targetField": "System.State",
257-
"defaultValue": "StateB",
258-
"valueMapping": {
259-
"StateA": "StateB"
260-
}
261-
},
262-
"FieldToFieldMap": {
263-
"ApplyTo": [ "SomeWorkItemType" ],
264-
"sourceField": "Microsoft.VSTS.Common.BacklogPriority",
265-
"targetField": "Microsoft.VSTS.Common.StackRank",
266-
"defaultValue": 42
267-
},
268-
"FieldToFieldMultiMap": {
269-
"ApplyTo": [ "SomeWorkItemType", "SomeOtherWorkItemType" ],
270-
"SourceToTargetMappings": {
271-
"SourceField1": "TargetField1",
272-
"SourceField2": "TargetField2"
270+
"ApplyTo": [ "SomeWorkItemType" ],
271+
"targetField": "Custom.ReflectedWorkItemId"
272+
},
273+
"FieldValueMap": {
274+
"ApplyTo": [ "SomeWorkItemType" ],
275+
"sourceField": "System.State",
276+
"targetField": "System.State",
277+
"defaultValue": "StateB",
278+
"valueMapping": {
279+
"StateA": "StateB"
280+
}
281+
},
282+
"FieldToFieldMap": {
283+
"ApplyTo": [ "SomeWorkItemType" ],
284+
"sourceField": "Microsoft.VSTS.Common.BacklogPriority",
285+
"targetField": "Microsoft.VSTS.Common.StackRank",
286+
"defaultValue": 42
287+
},
288+
"FieldToFieldMultiMap": {
289+
"ApplyTo": [ "SomeWorkItemType", "SomeOtherWorkItemType" ],
290+
"SourceToTargetMappings": {
291+
"SourceField1": "TargetField1",
292+
"SourceField2": "TargetField2"
293+
}
294+
},
295+
"FieldToTagMap": {
296+
"ApplyTo": [ "SomeWorkItemType" ],
297+
"sourceField": "System.State",
298+
"formatExpression": "ScrumState:{0}"
299+
},
300+
"FieldToTagFieldMap": {
301+
"ApplyTo": [ "SomeWorkItemType" ],
302+
"sourceFields": [
303+
"System.Description",
304+
"Microsoft.VSTS.Common.AcceptanceCriteria"
305+
],
306+
"targetField": "System.Description",
307+
"formatExpression": "{0} <br/><br/><h3>Acceptance Criteria</h3>{1}"
308+
},
309+
"RegexFieldMap": {
310+
"ApplyTo": [ "SomeWorkItemType" ],
311+
"sourceField": "COMPANY.PRODUCT.Release",
312+
"targetField": "COMPANY.DEVISION.MinorReleaseVersion",
313+
"pattern": "PRODUCT \\d{4}.(\\d{1})",
314+
"replacement": "$1"
315+
},
316+
"FieldValueToTagMap": {
317+
"ApplyTo": [ "SomeWorkItemType" ],
318+
"sourceField": "Microsoft.VSTS.CMMI.Blocked",
319+
"pattern": "Yes",
320+
"formatExpression": "{0}"
321+
},
322+
"TreeToTagMap": {
323+
"ApplyTo": [ "SomeWorkItemType" ],
324+
"toSkip": 3,
325+
"timeTravel": 1
273326
}
274-
},
275-
"FieldToTagMap": {
276-
"ApplyTo": [ "SomeWorkItemType" ],
277-
"sourceField": "System.State",
278-
"formatExpression": "ScrumState:{0}"
279-
},
280-
"FieldToTagFieldMap": {
281-
"ApplyTo": [ "SomeWorkItemType" ],
282-
"sourceFields": [
283-
"System.Description",
284-
"Microsoft.VSTS.Common.AcceptanceCriteria"
285-
],
286-
"targetField": "System.Description",
287-
"formatExpression": "{0} <br/><br/><h3>Acceptance Criteria</h3>{1}"
288-
},
289-
"RegexFieldMap": {
290-
"ApplyTo": [ "SomeWorkItemType" ],
291-
"sourceField": "COMPANY.PRODUCT.Release",
292-
"targetField": "COMPANY.DEVISION.MinorReleaseVersion",
293-
"pattern": "PRODUCT \\d{4}.(\\d{1})",
294-
"replacement": "$1"
295-
},
296-
"FieldValueToTagMap": {
297-
"ApplyTo": [ "SomeWorkItemType" ],
298-
"sourceField": "Microsoft.VSTS.CMMI.Blocked",
299-
"pattern": "Yes",
300-
"formatExpression": "{0}"
301-
},
302-
"TreeToTagMap": {
303-
"ApplyTo": [ "SomeWorkItemType" ],
304-
"toSkip": 3,
305-
"timeTravel": 1
306-
}
307327
}
308328
},
309329
"TfsChangeSetMappingTool": {

docs/_data/reference.fieldmaps.fieldcalculationmap.yaml

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,48 @@ configurationSamples:
2626
- name: sample
2727
order: 1
2828
description:
29-
code: There is no sample, but you can check the classic below for a general feel.
29+
code: >-
30+
{
31+
"MigrationTools": {
32+
"Version": "16.0",
33+
"CommonTools": {
34+
"FieldMappingTool": {
35+
"FieldMaps": [
36+
{
37+
"ApplyTo": [
38+
"Bug",
39+
"Task"
40+
],
41+
"expression": "[effort] * [rate]",
42+
"FieldMapType": "FieldCalculationMap",
43+
"parameters": {
44+
"effort": "Custom.EstimatedHours",
45+
"rate": "Custom.HourlyRate"
46+
},
47+
"targetField": "Custom.EstimatedCost"
48+
}
49+
]
50+
}
51+
}
52+
}
53+
}
3054
sampleFor: MigrationTools.Tools.FieldCalculationMapOptions
3155
- name: classic
3256
order: 3
3357
description:
3458
code: >-
3559
{
3660
"$type": "FieldCalculationMapOptions",
37-
"expression": null,
38-
"parameters": {},
39-
"targetField": null,
61+
"expression": "[effort] * [rate]",
62+
"parameters": {
63+
"effort": "Custom.EstimatedHours",
64+
"rate": "Custom.HourlyRate"
65+
},
66+
"targetField": "Custom.EstimatedCost",
4067
"ApplyTo": [
41-
"*"
68+
"*",
69+
"Bug",
70+
"Task"
4271
]
4372
}
4473
sampleFor: MigrationTools.Tools.FieldCalculationMapOptions

docs/_data/reference.tools.fieldmappingtool.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ configurationSamples:
3333
"FieldMappingTool": {
3434
"Enabled": "True",
3535
"FieldMaps": [
36+
{
37+
"ApplyTo": [
38+
"Bug",
39+
"Task"
40+
],
41+
"expression": "[effort] * [rate]",
42+
"FieldMapType": "FieldCalculationMap",
43+
"parameters": {
44+
"effort": "Custom.EstimatedHours",
45+
"rate": "Custom.HourlyRate"
46+
},
47+
"targetField": "Custom.EstimatedCost"
48+
},
3649
{
3750
"ApplyTo": [
3851
"SomeWorkItemType"
@@ -70,6 +83,19 @@ configurationSamples:
7083
}
7184
],
7285
"FieldMapSamples": {
86+
"FieldCalculationMap": {
87+
"ApplyTo": [
88+
"Bug",
89+
"Task"
90+
],
91+
"expression": "[effort] * [rate]",
92+
"FieldMapType": "FieldCalculationMap",
93+
"parameters": {
94+
"effort": "Custom.EstimatedHours",
95+
"rate": "Custom.HourlyRate"
96+
},
97+
"targetField": "Custom.EstimatedCost"
98+
},
7399
"FieldClearMap": {
74100
"ApplyTo": [
75101
"SomeWorkItemType"

docs/collections/_reference/reference.fieldmaps.fieldcalculationmap.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,48 @@ configurationSamples:
2727
- name: sample
2828
order: 1
2929
description:
30-
code: There is no sample, but you can check the classic below for a general feel.
30+
code: >-
31+
{
32+
"MigrationTools": {
33+
"Version": "16.0",
34+
"CommonTools": {
35+
"FieldMappingTool": {
36+
"FieldMaps": [
37+
{
38+
"ApplyTo": [
39+
"Bug",
40+
"Task"
41+
],
42+
"expression": "[effort] * [rate]",
43+
"FieldMapType": "FieldCalculationMap",
44+
"parameters": {
45+
"effort": "Custom.EstimatedHours",
46+
"rate": "Custom.HourlyRate"
47+
},
48+
"targetField": "Custom.EstimatedCost"
49+
}
50+
]
51+
}
52+
}
53+
}
54+
}
3155
sampleFor: MigrationTools.Tools.FieldCalculationMapOptions
3256
- name: classic
3357
order: 3
3458
description:
3559
code: >-
3660
{
3761
"$type": "FieldCalculationMapOptions",
38-
"expression": null,
39-
"parameters": {},
40-
"targetField": null,
62+
"expression": "[effort] * [rate]",
63+
"parameters": {
64+
"effort": "Custom.EstimatedHours",
65+
"rate": "Custom.HourlyRate"
66+
},
67+
"targetField": "Custom.EstimatedCost",
4168
"ApplyTo": [
42-
"*"
69+
"*",
70+
"Bug",
71+
"Task"
4372
]
4473
}
4574
sampleFor: MigrationTools.Tools.FieldCalculationMapOptions

0 commit comments

Comments
 (0)