How can I map the value from radio button custom field selection to a custom field of number type

Ed Cook March 26, 2016

I wan to map the value from one custom field to another custom field

my manager would like the value os our "level of effort" field of type radio button mapped into "story points" of type number field. 

the reason for this is so the engineers can select the level of effort from a list rather than putting a number in, this will be used for the Agile estimating and must be a number field from what I see.

 

I am trying to use java script in the "level of effort" description box but it is not working and I think it is because I do not have the proper names of the database structures, I am not sure number filed has selectedIndex 

I also want to hide the "Story Points" field so it cannot be changed.

below is the java script I am using ("level of effort" id is 11053, "Story Points" id is 10002

 

<script type="text/javascript" charset="utf-8" id="storyPointsCustomFieldScript">
function setIssueStoryPoints(e) { // set the value of the story point field here:
if(document.getElementById("customfield_11053_1").checked) { document.setElementById("customfield_10002").numberValue = 1; } else
if(document.getElementById("customfield_11053_2").checked) { document.getElementById("customfield_11051").selectedIndex = 2; } else
if(document.getElementById("customfield_11053_3").checked) { document.getElementById("customfield_11051").selectedIndex = 3; } else
if(document.getElementById("customfield_11053_4").checked) { document.getElementById("customfield_11051").selectedIndex = 4; } else
if(document.getElementById("customfield_11053_5").checked) { document.getElementById("customfield_11051").selectedIndex = 5; } }
function hideStoryPointsHook() {
var row = document.getElementById("storyPointsFieldArea");
row.style.display = 'none';
AJS.$("#customfield_11053_1").parents('form').submit(setIssueStoryPoints); }
var currentLocation = window.location.href; if (currentLocation.indexOf('CreateIssue') > -1 || currentLocation.indexOf('EditIssue') > -1) {
AJS.$(document).ready(hideStoryPointsHook); }
</script>

2 answers

0 votes
Ed Cook March 28, 2016

I looked into it, but that will only happen on a transition of the ticket.

I would like to have the ability for the field to be edited without transitioning the state

Elifcan Cakmak
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.
March 28, 2016

is your "level of effort" field only filled in edit screen? if "level of effort" is filled on creation screen also, for example, you can add it to your create transition. 

Ed Cook March 29, 2016

the "level of effort" may get changed at any time, which is why I would like to have the "Story Points" updated via a script when the "level of effort" is changed

 

the reason for doing this is to have a set number of options via the "level of effort" radio buttons that can be selected and automatically set in the "Story Points" number field which is used by Agile board to set estimates. The estimates must be a number field and will permit more options than we want and also will not allow displaying detail about all the available options on the edit screen that the radio type does allow.

 

I am open to doing this a different way, I just do't know of any other way to do it.

0 votes
Elifcan Cakmak
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.
March 27, 2016

hi,

have you tried using JIRA suite utilities post function "Copy Value From Other Field Post-Function"?

https://jsutil.atlassian.net/wiki/display/JSUTIL/JIRA+Suite+Utilities+Workflow+Post-Functions

Ed Cook April 3, 2016

the "level of effort" may get changed at any time, which is why I would like to have the "Story Points" updated via a script when the "level of effort" is changed

 

the reason for doing this is to have a set number of options via the "level of effort" radio buttons that can be selected and automatically set in the "Story Points" number field which is used by Agile board to set estimates. The estimates must be a number field and will permit more options than we want and also will not allow displaying detail about all the available options on the edit screen that the radio type does allow.

 

I am open to doing this a different way, I just do't know of any other way to do it.

Suggest an answer

Log in or Sign up to answer