How can I set a numerical value for a select list?

Mark McD
Contributor
October 31, 2011

I've got a select list set up as a custom field in Jira and wish to use it in Greenhopper's statistical burndown charts.

The specific field that I'm implementing is a "T-Shirt Size" field for story estimation. I have started to follow the steps here but now need to attach numbers so I can use it for calculations / charts.

How can I set up a mapping between a textual label and a numerical value in a Jira custom field?

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 31, 2011

You'll need some code to do that. There is no "mapping" function - the options on a select list are served up as strings to the things that ask the field for values.

So if you want to put numbers into a list, you need to write a field plugin that will present the data as numbers to the rest of the code, but handle like it's a select list. (I don't think this is a trick you can do with javascript or anything quick and easy on t the front end)

A lighter option though - set up a standard select list with your values, then set up a numeric field as well. Call them something similar, and don't put the numeric field on any edit/transition screens, and don't put the select list on display screens. Then write a small listener or postfunction that will read the select list and populate the numeric in the background (script runner plugin would make that a doddle)

Mark McD
Contributor
February 13, 2012

For prosperity's sake, I'll include my specific solution: I ended up taking the two list approach you suggested and set up a filter subscription on the mismatching issues ("Inconsistent Story Points / T-Shirt Size") that ran frequently so I could manually update the issues. It's not fully automatic but it is good enough for my needs.

Suggest an answer

Log in or Sign up to answer