Can I change a custom attribute from medium string to large string?
Hello,
Our work item for backporting changes uses a custom attribute to track instructions for applying the fix. The custom attribute is a Medium String.
If the attribute is not empty when change sets associated with the work item are included in a release, a script adds the text from the custom attribute to the readme.txt file that ships with the fix.
Medium string is not long enough for the instructions. How can this attribute be changed to use a Large String instead without losing what is already on existing work items?
Thanks,
Ruby
Martha (Ruby) Andrews
Jazz Foundation L3 Development Lead
Our work item for backporting changes uses a custom attribute to track instructions for applying the fix. The custom attribute is a Medium String.
If the attribute is not empty when change sets associated with the work item are included in a release, a script adds the text from the custom attribute to the readme.txt file that ships with the fix.
Medium string is not long enough for the instructions. How can this attribute be changed to use a Large String instead without losing what is already on existing work items?
Thanks,
Ruby
Martha (Ruby) Andrews
Jazz Foundation L3 Development Lead
Accepted answer
You cannot change the type of an existing attribute. You would have to create a new custom attribute, and then write a script that would find all work items with the old custom attribute, and copy its value the new custom attribute.
Comments
and then update the script which adds the text from the custom attribute into the readme file to now take into account the reading from the new custom attribute instead of the old custom attribute.
once you copy the data from the old field to the new field, you can rename the old one out of the way, and the new one to the old name. the ID string will be different, but the name will be right.
One other answer
Hello Ruby,
Geoff is correct - you can not change an attribute's type.
And you'll have to create a new attribute.
Now the tricky thing is to move the old attribute values for existing work items.
As Geoff suggested, you may write a script.
Another option I used in similar cases is to CSV export your work items - only id's and your old attribute's values.
Then CSV Import and map old to new attribute.
Eric
Comments
Problem with string attributes sometimes seems to be the line breaks. You can only try.
I am considering to put something into the workitem command line if it can be kept simple.