How to disable an issueType in the dropdown list on issue creation ?

Valerie AQUILA June 10, 2013

In a project, I've got several issue types, but I need to prohibit one value on Issue creation.

This issue type just comes when a particular group with permission move issues with other issue types.

I'm in jira 5.2

Is it feasible ?

Maybe with javascript in announcement banner ?

Thanks for any help!

5 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 10, 2013
1 vote
MatthewC
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.
June 10, 2013
Valerie AQUILA June 13, 2013

Thank you very much !

I finaly use some Javascript in the announcement banner, like described here :

https://answers.atlassian.com/questions/159034/hide-issue-type

<script type="text/javascript">
jQuery(document).ready(function($) {
    JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) {
        $("#issuetype option").each(function()  {
   if( $(this).text() == 'issuetype name' || $(this).text() == 'issuetypename' ){
    $(this).remove();
        }
    });
    });
});
</script>

Thanks to everybody who has answer and thanks to

rambanam prasad!

Deepali Bagul February 24, 2017

This doesn't work for JIRA 7.2.3. @Rambanam Prasad any suggestions. Thanks in advance.

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.
February 27, 2017

Deepali Bagul Issue type field implementation has changes on latest JIRA, in older versions it is a single select field and in latest versions it seems autocomplete field.

use firebug on firefox or dev tools on chrome  and go through inspect the issuetype field to understand the implemetation.

 

Deepali Bagul July 31, 2017

Hello @RambanamP,

I still cannot resolve this I tried with the webresource on jira 7.2.3

Below is the code 

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())== 'Role Mapper'){
$(this).remove();
}
});
}
});

Thanks in advance

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 it is not an issue with webresource, as i explained on my previous comment, you have to understand implementation of project and issue type fields, that is why i ask you to use firebug go though source of project and issue type fields. 

zekunova August 2, 2018

@RambanamP

Hello. I am new to scriptrunner and have the same request as discussed in this question. Can you help me understand?

How can I hide issue types on a create transition from users based on their group or project role?

Is javascrip is the only way to solve this issue?

0 votes
Bhupesh Nagda April 21, 2015

I am using jira 6.1.5

0 votes
Bhupesh Nagda April 21, 2015

Hi @Sebastian Kouba , @Valerie AQUILA

I am using below JS in Announcement banner to restrict users from viewing "Correction" issue type as a part of drop down options under Issue Type field. But it is not working. If you could, can you please help !!

 

Also I am not able to find relevant logs so I don't know what is wrong.

 

<script type="text/javascript">
AJS.$(document).ready(function() 
{
setInterval(function()
{
if(AJS.$("#project-name-val").html()=="ABC")
{
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) 
{
AJS.$("#issuetype option").each(function() 
{
var mystring = AJS.$(this).text();
mystring = mystring.replace(/\s/g, '');
if( AJS.$(this).text().replace(/\s/g, '') == 'Correction')
{
AJS.$(this).remove();
}
});
});
}
}, 500);
});
</script>

 

Any help will be appreciated

 

Thanks a lot!!

0 votes
SebastianK April 10, 2014
When I tried to use the code above it didn't work because it turned out that the text included a lot of whitespace. The Regexp removes it so the following code worked for me:
<script type="text/javascript">
jQuery(document).ready(function($) {
    JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) {
        $("#issuetype option").each(function()  {
var mystring = $(this).text();
mystring = mystring.replace(/\s/g, '');
   if( $(this).text().replace(/\s/g, '')  == 'Activity'){
    $(this).remove();
        }
    });
    });
});
</script>

Dinesh November 11, 2018

Hi Sebastian,

 

where shall i need to write this code in Jira 7.7 version for my requirement, please tell me.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events