Hi,
I've updated my JIRA instance in from 6.3.15 to 6.4.6.
I used a script to disable some issue type with javascript for group of people on the issue creation screen, but my script doesn't work anymore and I don't understand why.
jQuery(document).ready(function($) { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) { $("#issuetype option").each(function() { if( $(this).text().trim() == "Type1" || $(this).text().trim() == "Type2") { $(this).remove(); } }); }); }); }
It seems that this script is not executed.
It worked perfectly in 6.3.15.
Has anybody an idea?
Thank you
We just recently upgraded to 6.4 and I had to figure it out as well. It seems like the select has been replaced with a single-select that pulls the information from another source, so this is what I did to remove the issue types. It's not so elegant, but at least it works OK. It should actually work on 6.3 as well.
jQuery(document).ready(function() { var removeIssueType = function() { jQuery("a[title='type1']").parent().hide(); jQuery("a[title='type2']").parent().hide(); } var findIssueType = function() { jQuery("span.drop-menu").click(removeIssueType); jQuery("#issuetype-field").keyup(removeIssueType); jQuery("#issuetype-field").click(function() { setTimeout(removeIssueType, 1); }); jQuery("#project").change(function() { setTimeout(findIssueType, 1000); }); } if (AJS.params.loggedInUser !== "allowed.user") { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) { findIssueType(); }); setTimeout(findIssueType, 500); } });
That should be enough to get you started for any customizations. Just replace "type1" and "type2" with the types you want to remove.
we have JIRA 7.0.2, but script is not working correctly, I am doing any mistake,Please let me know,
Thank you for the help.
jQuery(document).ready(function() { var removeIssueType = function() { jQuery("a[title='Core Patch Request']").parent().hide(); jQuery("a[title='Customization Patch Request']").parent().hide(); } var findIssueType = function() { jQuery("span.drop-menu").click(removeIssueType); jQuery("#issuetype-field").keyup(removeIssueType); jQuery("#issuetype-field").click(function() { setTimeout(removeIssueType, 1); }); jQuery("#project").change(function() { setTimeout(findIssueType, 1000); }); } JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) { findIssueType(); }); setTimeout(findIssueType, 500); });
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, sorry, I guess I never updated it since they removed the title element sometime during the 6.4 development process. This version should work (just tested it with the latest version of JIRA Cloud):
<script> jQuery(document).ready(function() { var removeIssueType = function() { jQuery(".aui-list-item-link").filter(function(){ return jQuery(this).text() === "Core Patch Request" || jQuery(this).text() === "Customization Patch Request" }).parent().hide(); } var findIssueType = function() { jQuery("span.drop-menu").click(removeIssueType); jQuery("#issuetype-field").keyup(removeIssueType); jQuery("#issuetype-field").click(function() { setTimeout(removeIssueType, 1); }); jQuery("#project").change(function() { setTimeout(findIssueType, 1000); }); } JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) { findIssueType(); }); setTimeout(findIssueType, 500); }); </script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey, @Stephen Deutsch is there a possibility to use project category instead of project name ? Like there are many projects which needs to hide few issuetypes and needs to be hidden based on category. Thank you so much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Team,
kindly tell me where we need to use this code to hide the issue type in jira?????
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am facing the same problem. Can i have sample code snippet please.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi it works fine, thank you very much for your help!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
thank you for your answers. I'll test it tomorrow and give you my feed back.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is because Atlassian switched to AUI Select 2 component :
<div class="aui-list" id="issuetype-suggestions" tabindex="-1" style="display: block;"> <div class="aui-list-scroll" tabindex="-1"> <ul class="aui-last"> <li class="aui-list-item aui-list-item-li-bug active"><a class="aui-list-item-link aui-iconised-link" href="#" title="Bug"><img class="icon" alt="" src="...">Bug</a></li> <li class="aui-list-item aui-list-item-li-epic"><a class="aui-list-item-link aui-iconised-link" href="#" title="Epic"><img class="icon" alt="" src="...">Epic</a></li> <li class="aui-list-item aui-list-item-li-technical-task"><a class="aui-list-item-link aui-iconised-link" href="#" title="Technical Task"><img class="icon" alt="" src="...">Technical Task</a></li> </ul> </div> </div>
You have to adapt your code and remove the aui-list-item element corresponding to the issue type you want to remove, they all have a specific class:
aui-list-item-li-bug
aui-list-item-li-epi
etc ..
Beware though, this element is appended to the DOM when the user focus the issue type select.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems that the <select id='issuetype' has disapeared...
I don't know how to adapt my script. I only find div
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.