This question is in reference to Atlassian Documentation: Setting Priority field value based on customfield value
Should this work in JIRA v6.3.15?
Yes sure you can do it easy. Use Script Runner, JJupin plugin
Any question ? let me know...
I tried putting java script in the description field as described but did not get the desired action
@Ed Cook It would be helpful if you could provide the javascript that you have used so that others on here can spot any issue with it. One part to carefully check is how you have picked up the customfield id and used that in the javascript.
I am trying to have the field "Story Points" set from radio buttons "Level of effort"
I get the id from
here is the javascript I am trying to use
<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.getElementById("Story Points").selectedIndex = 1; } else if(document.getElementById("customfield_11053_2").checked) { document.getElementById("Story Points").selectedIndex = 2; } else if(document.getElementById("customfield_11053_3").checked) { document.getElementById("Story Points").selectedIndex = 3; } else if(document.getElementById("customfield_11053_4").checked) { document.getElementById("Story Points").selectedIndex = 4; } else if(document.getElementById("customfield_11053_5").checked) { document.getElementById("Story Points").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>
One part of this that jumps out at me straight away is
document.getElementById("Story Points")
where I would expect to see something similar to what you have for the if condition.
document.getElementById("customfield_11053_4")
You are attempting to reference an element by its name not ID.
I was following the example in the FAQ "Setting Priority field value based on custom field value"
I looked at ScriptRunner but I would still need to know the specific structure and fields of the JIR DB.
Where can I learn more about it?
I am trying to map a value from a custom field that is a radio button into a custom field that is a number field
It looks like you're new here. Sign in or register to get started.