How to import some data as plain text from Word's tables
Assume that you want to import some tabular data from Word and that data looks like this. You want to import the "Summary" column to a Work Item's summary and the Description as description. Notice that the Summary column contains some bold formatted text.
If you normally import this as table from Word you will notice that the Summary field of the result data looks like this:
Why? This is happening because the Word import is converting the Word content to wiki and so it keeps the bold style and converts this to the bold text, which looks bad in the summary field which does not allow wiki text.
To fix this you will need to do some conversion during import. So start the import again, and on the 2nd page of the wizard you have the option to apply some conversion on the import field.
- On the "conversions" page of the wizard Click on "Configure advanced conversions"
- Choose "Script" conversion for the Summary field where you want Plain-text instead of Wiki
- Choose Groovy as script language
- Paste the script below to the "Script" editor
return com.intland.codebeamer.text.WikiToPlainTextConverter.extractTextFromWiki(input, request).getLeft();
This script converts the Wiki text which would go to Summary field to Plain text.
Once you continue with import you will see that the "Summary" is correctly imported.