disable issue type creation temporarily

Michal Crkon August 7, 2013

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
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 7, 2013

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>

Suresh March 31, 2016

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.
Deepali Bagul July 31, 2017

Hello @Suresh and @RambanamP

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!

RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 1, 2017

@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.

 

Deepali Bagul August 1, 2017

@RambanamP

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>

 

Dan27 July 24, 2018

Hi @Michal Crkon1 ,

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

1 vote
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2017

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>
Deepali Bagul August 2, 2017

Thankyou !

Suggest an answer

Log in or Sign up to answer