It's all about the answers!

Ask a question

Can I change a custom attribute from medium string to large string?


Martha (Ruby) Andrews (3.0k43951) | asked Feb 12 '15, 5:53 p.m.
JAZZ DEVELOPER
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

Accepted answer


permanent link
Geoffrey Clemm (29.6k23035) | answered Feb 13 '15, 1:43 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.
Ralph Schoon selected this answer as the correct answer

Comments
Susan Hanson commented Feb 13 '15, 8:05 a.m.

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.


sam detweiler commented Feb 13 '15, 8:09 a.m.

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



permanent link
Eric Jodet (6.3k5104120) | answered Feb 13 '15, 2:24 a.m.
JAZZ DEVELOPER
 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
Ralph Schoon commented Feb 13 '15, 4:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.

Your answer


Register or to post your answer.