Hi,
I am facing a problem using Javascript in the description field. As soon as I change the issue type (issue creation screen) the scripts are being ignored.
Example 1: Replacing the "None" option in select field
<script type="text/javascript">try {var select = document.getElementById('customfield_10071');select.options[0].text="";}
</script>
The code above is in a field description associated with a project and an issue type. If I create an issue and the issue is the first to pop up in the issue type list (e.g. the most recent to have been created) the scripts fire. If I select another issue type with other scripts in their field descriptions those are being ignored...
Example 2: Hiding the Assign to me link
<script type="text/javascript"> AJS.$("#assign-to-me-trigger").hide() </script>
Any of you has experienced this behaviour?
Thanks in advance
Christian
Found a solution. Fixed the none option problem in the VM-file (issue has been fixed by Atlassian aswell) and edited my JS to sth. like this
<script type="text/javascript"> jQuery(document).ready(function($) { XX(); JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) { XX(); }); }); function XX() </script>
you need to add javascript file using webresource module in plugin insted of adding in description
find thesample webresource module below
<web-resource key="test-js" name="javascript"> <dependency>jira.webresources:global-static</dependency> <description>JavaScript</description> <resource name="test.js" type="download" location="templates/js/test.js" /> <context>atl.general</context> </web-resource>
test.js file like
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) { AJS.$("#assign-to-me-trigger").hide() });
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey, I'll try that. Thank you in advance...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey rambanam, one question, why does the javascript, if I use it in the field description, just fire once?
Cheers Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.