1. Go to Jira Administration | Issues | Customer fields
2. Click on the Add customer field button in the top-right corner and select Field Type as Text Field (multi-line).
3. On the next screen, enter testfield as Name and enter the Javascript code into the Description field.
<script type="text/javascript">
priority=document.getElementById('priority');
if(priority){
target = document.getElementById('customfield_11502');
if (priority.value != 1)
target.style.display='none';
priority.onchange=function() {
if (this.value == 1) {
target.style.display = '';
target.value="enter message here";
} else {
target.style.display='none';
}}}
</script>