solidify / jira-azuredevops-migrator

Tool to migrate work items from Atlassian Jira to Microsoft Azure DevOps/VSTS/TFS.
MIT License
264 stars 228 forks source link

MapArray errors to map null/None value #1053

Open TKallem opened 5 months ago

TKallem commented 5 months ago

Describe the problem

I am trying to export Components field for Jira issues. In some issues, the components field value set from a value to null/empty/none in one of the revisions.

However when exporting the Components field, its failing to map the None value and produces the following error. [E][11:48:36] Error mapping field 'Custom.Components' on item 'DSPUBI-2133'. [System.ArgumentNullException] System.ArgumentNullException: Value cannot be null.

To Reproduce

Steps to reproduce the behavior:

  1. Create a Jira user story
  2. Set components field to a value and Save
  3. Remove value for components field and Save
  4. Set Components field to a value and Save
  5. Run the export process

Tool version

Attachments

Please attach the following files:

jira-export-log-240613-114833.txt config-agile.json

Screenshots Screenshot 2024-06-13 120043 image

Alexander-Hjelm commented 5 months ago

Something likely is not working as expected with the Array mapper. All of the above repro steps are really helpful in troubleshooting this issue, so thanks for that!

Marking as a bug.

Have you tried to omit the following line in your field map?

"source-type": "name",
TKallem commented 5 months ago

Hi @Alexander-Hjelm ,

Haven't tried omitting the source-type but I have commented out a line of code in MapArray method where its checking for null and throwing the exception and added a line to return null. It seems to work fine for me now.

image

Thanks, Thiru

Alexander-Hjelm commented 5 months ago

Hum, ok! Good catch. It feels like there might be a deeper underlying issue to this, so we might not want to create a PR with your fix right away.

Have you noticed anything about under what conditions the Array-type field becomes null?