I want to set the component field to a specific value for one issue type in a project (that component has no meaning to other issue types in the project, so I don't want a project-wide default). When the user selects "Create Issue" for this issue type, I want this value to show in the component/s field. i.e. a post-function won't do it. After reviewing many questions and search results I decided embedded javascript was the only option. I'm not real facile at this, but I've figured out the basics. I can check the component field for a value, and I can set the value of some other fields, like description. But how do I set the component field?
From looking at search results, I'm guessing this is a lot more complicated than something like this:
<script language="JavaScript">
if ( document.getElementById("components").value == 14730 )
document.getElementById("description").value = "I see it now";
</script>
which shows that I can access the component for a specific value and set the description. But that approach doesn't do anything to set the component.
Can someone direct me to the right stuff to set the component here? Thank you.
Community moderators have prevented the ability to post new answers.
I think you can try to do like this:
AJS.$("#components-textarea").val("somevalue").blur();
Sadly, AJS.$("#components-textarea").val("somevalue").blur(); won't work consistanly in IE8 or IE9.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can't the Script Runner plugin or Behaviours plugin do this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.