I want to hide javascript code when a user creates an issue from the Jira
overview of the issue:
There is a javascript for the custom field, however, the user should not see that when creating the ticket, but the script should be needed in the custom field.
Hi @Harish
I believe what you are seeing is two-sided:
- the Java Script codes does not work anymore
- the code is displayed to the user instead of being executed.
This all is happening after an upgrade, if so:
HTML support for custom field descriptions has been switched off due to security considerations by default. This was shipped in JRASERVER-70859 (Disallow HTML in custom field descriptions and list item values by default).
Good news is, it is still possible to enable this feature as explained in Configuring Jira application options.
Please see here for further information:
https://confluence.atlassian.com/adminjiraserver087/configuring-jira-application-options-998872637.html
Regards,
Daniel
Hi, @Harish Here's an alternative,
Install Automation for Jira Lite.
Create a separate custom field and when the user creates an issue write an automation rule such that it gets copied over to the field where you have written the javascript code and make the view issue screen non-editable. This will achieve your requirement to an extent but not up to mark for what you have asked.
May I know which plugin you are using for customizing fields?
Thanks,
Pramodh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Pramodh
I'm not using any add-on for this feature I'm using this as a javascript under the custom field description for some reasons after the upgrade to 8.12.1 when i switch the values it's not changing the other custom field values so scratching my head how to get this resolved any thoughts ?
{code}
<script type="text/javascript">
jQuery(document).ready(function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
callChangeFunction();
});
callChangeFunction();
function callChangeFunction(){
setFieldValue();
// dropdown custom field change function
$("#customfield_14695").change(function()
{ setFieldValue(); }
);
}
function setFieldValue(){
//drop down field selected value
var dropDownFieldval = $.trim($("#customfield_14695 :selected").text());
if(dropDownFieldval == 'New ECS Request')
{ $("#customfield_14659").val("42"); $("#customfield_14684").val("15922"); }
else
{ $("#customfield_14659").val("05"); $("#customfield_14684").val("15019"); }
}
});
</script>
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.