It's all about the answers!

Ask a question

How to change a custom attribute type


2
1
Mark Cocker (4687) | asked May 18 '09, 6:48 a.m.
Hello,

I created a custom attribute with a type of String, but now wish to
change it to type smallString.

I have tried selecting the attribute and clicking on "Edit..." but the
type is greyed out and cannot be changed.

I also tried removing the attribute and adding it back it, but once
removed, you cannot create a new attribute with the same name.

How can I change a custom attribute's type?
How can I remove -permanently- an attribute that is removed so I can add
it again?

Mark.

Accepted answer


permanent link
Ralph Schoon (63.1k33646) | answered Apr 03 '13, 5:55 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
See https://jazz.net/forum/questions/106987/is-it-possible-to-update-the-type-of-an-attribute

I don't think it is safe to use one of the proposals to modify the process XML. You might run into issues later.

The suggestion is to export the attribute data into CSV, include the work item ID in the export.
Then import data - only using the ID and the column renamed for the new attribute. Choose update existing work items. You might have to figure the mapping out, however, since you just update just the new work item attribute from the data of the old one, into the existing work item, you should not loose anything.
Daniel Toczala selected this answer as the correct answer

One other answer



permanent link
Jacob Leder (124) | answered Mar 27 '13, 8:28 p.m.
edited Mar 27 '13, 8:30 p.m.

Not sure if you have figured this out yet. Through the Process Configuration Source Tab of the Project Area you are able to override the XML values that are stored there to change the type. I have done that with String and Html, and it seems to work fine.

The case that I have not been able to fix is I am trying to change an attribute that is of type Interval to type Enumeration. It works, except for the Editor Presentation still sees the attribute as an Interval, but generates an error stating that the type should be and Enumeration. Except it is not giving the drop down option for the Enumeration.


Comments
Ralph Schoon commented Apr 03 '13, 6:13 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

You are risking to screw up your database doing this. My suggestion is to keep the old data and migrate it to a new attribute. Renaming the old attribute gets it out of the way.

All I know and all feedback I have seen is, doing what you try to is not a great idea and might cause serious issues in the long run. 


Jacob Leder commented Apr 04 '13, 12:35 p.m. | edited Apr 04 '13, 12:36 p.m.

If this is an usafe behavior, then why is this information stored in the Configuration File, and why are users given access to that information? Safe programming practices are to not give access to data that can break the system. So how do you guys control data integrity if I have access to it?

Can you expound on what issues it will cause?

How do you rename an attribute that has already been archived?


Ralph Schoon commented Apr 05 '13, 3:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

It is necessary to be able to edit the XML source in special cases, for example

  • Configure parameters for a Java Script Attribute Customization
  • Configure custom pre- and post-conditions that have no aspect editor
  • Add Formal Project Planning capabilities to agile projects

There are other border cases where access to the XML source and its modification is necessary. For example if you want to undo a change or see and compare the version history.

The XML gets also modified if using the UI, so it needs to be able to be written.

You might want to add an enhancement request here requesting that a special warning is shown that this can be unsafe.

The UI does not support changing the type today for good reasons. I don't know the gory details because that is hidden in the persistency layer. If you just did it with string attributes, you might be safe, dependent on how they are stored.


Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.