How to manipulate issue type options in JIRA 6.4.1 using javascript

I'd just upgraded our JIRA instance from 5.2.5 to 6.4.1.

There is an existing javascript where we could hide some issuetpyes based on some condition.

Apparently due to the changes on aui in JIRA 6.4, it changed the behavior of the issue type field.

Existing working code:

<script type="text/javascript">
jQuery(document).ready( function($)
{
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context)
{
callJSFunction();
});
callJSFunction();
function callJSFunction()
{

var select2 = document.getElementById("issuetype");

select2.options[1] = null;

}
});

</script>

Any idea would be appreciated.

Thanks.

 

2 answers

1 accepted

I'd resolve the problem myself...using external plugin.

"Issue Type Filters".

 Can you try this way?

jQuery(document).ready( function($) {

JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) {

       setTimeout(function() {callJSFunction();}, 50);

});

function callJSFunction() {

var select2 = document.getElementById("issuetype");

alert(select2)

}

}

 

Hi Srinivas, Thanks for your replied but i dont see the point of alerting the "document" object...

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 6 hours ago in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

19 views 0 3
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