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

This widget could not be displayed.

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 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!

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

 

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

 

Hi @Michal Crkon1 ,

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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

128 views 2 0
Join discussion

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