How to automatically sort an enumeration?
I have a work item attribute type enumeration in my RTC (3.0.1) called customer, which contains around one hundred entries to start with. This enumeration is a drop-down field when creating a new work item, so an end user selects a customer from this dropdown list. A requirement is that, when adding new values to that enumeration, the customer list is automatically sorted when a new work item is made, even when the values are not sorted in the process configuration. The way I do it now, is when adding new values, I do this directly in the process configuration xml file directly, taking out the old values first, copy them to excel, add the new values in excell, sort them and put them back in the process configuration file. I'm searching for a smarter way of doing this now. Any ideas on how this could be done? Value set providers? Writing an extension? Is there a way to programmatically connect to the process configuration file, parse from there the customer values, sort them and diplay them in the workitem dropdown list? Would like to know in what direction to go when implementing this. Any ideas? Your thoughts are very much appreciated. Regards, Luc
2 answers
Have you looked at HTTP Filtered Value Sets -- see https://jazz.net/library/article/1003/ I see these available on my 3.0.1.4 server -- check your process configuration -> configuration data -> work items for this section. That's certainly one possible answer. There's even a checkbox on the configuration for "Sort values received from data source". :-)
At 4.x you can create enumerations where the values are stored in a database rather than the process specification (which might be the perfect answer to your issue, but that option is not available at 3.0.1.x).
I just tried one in 4.x using the database -- it still keeps them in the order you enter them. The web UI makes it easy to reorder them, so it should be quite as painful (or as dangerous) as replacing segments of the process spec, but it's still on you to maintain order if you use a standard enumeration.
I still think a filtered value set is likely your best choice here.