Migrating from Agile 1.0 to Agile 2.0 breaks the formatting for Acceptance Criteria


Description

After upgrading from Agile 1.0 to Agile 2.0 the formatting of the Acceptance Criteria in all existing stories has been broken.
Going from a String to the HTML based field requires line breaks to be inserted in order to get this to display properly.

The Story Templates also need to be updated to include at the each of every line.

Cause

Due to the change in dictionary type

Resolution

You can run the below script in the background to convert the spaces into the new line.

script:
var updatedStories = [];
var oldNextLineCharacter = '\n';
var newNextLineCharacter = '
';
var storyGr = new GlideRecord('rm_story');
storyGr.addQuery('acceptance_criteria', 'CONTAINS', oldNextLineCharacter);
storyGr.query();
while(storyGr.next()){
var ac = storyGr.getValue('acceptance_criteria');
storyGr.setValue('acceptance_criteria', ac.replaceAll(oldNextLineCharacter, newNextLineCharacter));
storyGr.update();
updatedStories.push(storyGr.getValue('number'))
}
gs.info('Total number of stories updated :: '+ updatedStories.length);
gs.info('updated stories :: \n '+ updatedStories);

Please test this in your sub prod before executing in the production