Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor StringManipulator tool so it works just with string and not work item field #2548

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

satano
Copy link
Contributor

@satano satano commented Dec 3, 2024

This should fix #2538

As mention id that bug report, custom user mapping is not applied during migration. @LudekStipal pointed to the code it was responsible for this. The problem is not the StringManipulatorTool itself, but the value which is used in that branch of code. The user mapping and all the other field mapping is done using oldWorkItem object, which is of type Field. But that specific branch for strings was processed using oldWorkItemData object which is of type FieldItem. So it is the different object and for user fields, it is not working with mapped user names, because the are mapped in the other place.

This is at least a bug for user fields which are mapped as @LudekStipal found. But I think, that is is also a potential source of bugs in the future, if something will be changing here. Because the one who will be changing something here may not notice, that populating work item fields it is done in different way for the strings.

StringManipulatorTool was working with FieldItem type. At first, I wanted to change it to work with Field type, so it would work the same way as user mapping. But this is not possible, because Field type is from TFS client library, but StringManipulatorTool in in different (lower level) assembly where this is not accessible. So I changes StringManipulatorTool that it does not take a whole field as argument, but just a string and returns new string. Basically, it does what it name suggests – takes a plain string, manipulates it and returns a new string. It was used only in this one place.

This may be a breaking change. The potential problem may be, than FieldItem was modified by StringManipulatorTool until now and now it remains the same. I am not sure if this can be a real issue.

@satano satano requested a review from MrHinsh as a code owner December 3, 2024 18:39
@MrHinsh MrHinsh merged commit 5451700 into nkdAgility:main Dec 4, 2024
11 checks passed
@satano satano deleted the fixWorkItemMigration branch December 4, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Custom User Mappings not being applied during migration
2 participants