disable issue type creation temporarily

Hi,

I have number of issue types (epic, story new feature etc.) I want temporarily disable people creating issue type 'New Feature' for a few days.

I tried to remove issue type from my scheme but that meant i would have to migrate current new features to another issue type, which is not an option.

Any ideas how can this be done?

2 answers

1 accepted

0 votes
Answer accepted

you can hide issuetype with Javascript , try something like this by adding in footer.jsp or load it as webresource in any plugin

<script type="text/javascript">  
jQuery(document).ready(function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) {
		hideIssueType();
	});
	
	hideIssueType();
function hideIssueType(){
		hide();
	$("#project-field").change(function(){
		hide();			
	});			
	
}
function hide(){
		$("#issuetype option").each(function()	{				
				if($.trim($(this).text()) == 'Defect'){				
					$(this).remove();
				}
			});

}

});
</script>

Hi Prasad,

I have added this in my web resource, but the script is working only up to the alert,Control is going in side each function. Is there any change in JIRA 7.

 

function hide(){
alert('In hide');
        $("#issuetype option").each(function()    { 
                 alert('In issue options');             
                if($.trim($(this).text()) == 'Defect'){            
                    $(this).remove();
                }
            });
 
}
Thanks for the help.

Hello @suresh babu and @Rambanam Prasad

Were you able to resolve this with webresource. I stuck with the same problem the script works upto alert. I am on jira 7.2.3 Can you please guide me.

Thankyou!

@Deepali Bagul if you are getting alert that means webresource module is working fine.

project and issue type field implementation got changed on latest jira versions so you need to understand these fields implementation first.

 

@Rambanam Prasad

Thankyou for pointing me to right direction field implementation.  

Below is the javascript that worked for me on jira 7.2.3 with webresource.

 

<script> jQuery(document).ready(function() {   var removeIssueType = function() {     jQuery(".aui-list-item-link").filter(function(){ return jQuery(this).text() === "Role Mapper" }).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 !== "") {     JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) {       findIssueType();     });     setTimeout(findIssueType, 500);   //} }); </script>

 

Hi @Michal Crkon1 ,

Can you help me understand where can I put this script ??

I don't have option to edit @Deepali Bagul comment so am adding as answer with proper format so it will help others 

 

<script>
jQuery(document).ready(function($) {
var removeIssueType = function() {
$(".aui-list-item-link").filter(function(){return $(this).text() === "Role Mapper" }).parent().hide();
}

var findIssueType = function() {
$("span.drop-menu").click(removeIssueType);
$("#issuetype-field").keyup(removeIssueType);
$("#issuetype-field").click(function() {
setTimeout(removeIssueType, 1);
});

$("#project").change(function() {
setTimeout(findIssueType, 1000);
});
}


JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) {
findIssueType();
});
setTimeout(findIssueType, 500);

});
</script>

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Jira

Updates to jira.atlassian.com give you visibility into what's coming in Jira Server and Data Center

Hello, Community! My name is Gosia and I'm a Product Manager on Jira Server and Data Center here at Atlassian. Since 2002 when we launched our public issue tracker, jira.atlass...

644 views 1 15
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you