It's all about the answers!

Ask a question

How to automatically sort an enumeration?

Luc Rotsaert (6113) | asked Dec 19 '12, 7:21 p.m.
edited Dec 21 '12, 8:56 a.m.
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

permanent link
Millard Ellingsworth (2.5k12431) | answered Jan 03 '13, 10:15 p.m.
Have you looked at HTTP Filtered Value Sets -- see  I see these available on my 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). 

Srihari G commented Dec 30 '13, 4:20 a.m. | edited Dec 30 '13, 2:12 p.m.
Hi Millard/Luc,

Could you please let me know how to do automatically sort an enumeration in 4.x.

Thanks in advance.


permanent link
Millard Ellingsworth (2.5k12431) | answered Dec 30 '13, 2:15 p.m.
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.

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.