How do I order the items in a Multi-Select Typed Parameter?

I've created a build configuration with Typed Parameters for my Environment Variables. One of these variables in particular needs over 50 select item values. Whenever I save the items in the spec field, TeamCity randomly shifts the order of the select items. I need the items in the select list in a specific order, or at the very least in alphabetical order. TeamCity keeps re-ordering the list for me when saved no matter what order I put the items in.

Is there any way to specify sort order for these? Is there a way to get TeamCity to respect the order of the items I enter in the Spec Items field?

I see the following format in the Raw value, however, this is very difficult to read and edit with the amount of items I have. Please tell me there is a better way.

select data_01='Value1' data_03='Value2' data_05='Value3' data_07='Value4' data_09='Value5'
display='prompt' label='Label Example' label_01='Label1Text' label_03='Label2Text' label_05='Label3Text' label_07=Label4Text'

Any help is greatly appreciated. Thanks!

Comment actions Permalink

I found the problem. When you enter a bunch of items in the Spec Items field and then Save, TeamCity assigns random keys to the items entered in the format data_###. However, it uses two digit numbers for the second part of that format. So, when your list of items gets past data_99, you will see sorting problems where data_13 will sort in between data_129 and data_130. A workaround for now is to edit all of the two-digit numbers in the Raw field by adding a leading zero. For example, data_01 becomes data_001.

This seems like a bug in TeamCity but for now the workaround works. Also, I've noticed a bug where the "Edit Parameter Specification" dialog does not load the Form when the Spec Items is a large list like mine. I've resorted to using text files to store all of this data and copy/pasting into the Raw data field to avoid this for now. Bottom line, there's a couple of bugs with Typed Parameters when you have more than 50+ values for a parameter.

Comment actions Permalink

Hi Paul,

We received the same request from other customer and created the request in the tracker: Please vote for it.


Please sign in to leave a comment.