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

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

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

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.

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

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. 

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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,312 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot