Hi,
I wrote java script in description field for custom fields dependency enumeration in jira, but the problem it is replicated in create issue screen, not in "view issue screen".
If modified the options in custom dropdown once has created , my javascript is not loading on that View issue screen page.Kindly suggest on this!!
Javascript hacks are really not recommended as you have to make them work in many different places and that means hacking different code into many places. You are going to need to inject the javascript everywhere, and this can only really be done by using the announcement banner. But you should expect the ability to run javascript there to go away eventually.
I'd suggest doing your "enumeration" properly - with add-ons that handle the code for you, or, better, fields that do the work without bodging hacks in.
Thanks alot Nic for your valuable information,
can we make it, for particular functionality using Announcement banner?
Even though using Add-on's , should not able put different names for three individual dropdowns in dependency enumeration , so finally i have implemented using javascript
and achieved it, working fine while creating issue.
but the problem is that, java script is not loading in once issue has created i.e; view issue screen.
Kindly suggest on this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's impossible to say without seeing what you're injecting and how you've tried to make it work. Have you tried to deal with all 9 places you might have to "enumerate" your field, or are you only trying to deal with the 4 main places you need to do it?
(I should also point out that I'm not a Javascript coder - I don't use it much, other than reading stuff I'm going to remove from Jira so it can be done properly instead)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
Please find below code for dependency enumeration.
It is working in create,edit issue screen and not in view issue screen once has created i.e; on the screen.
Please do needful
<script type="text/javascript">
var Country1 = document.getElementById("customfield_10101");
var State1 = document.getElementById("customfield_10102");
if(Country1.options[Country1.selectedIndex].text=="None"){
for(i=1;i<6;i++){
State1[i].style.display='none';
}
}
Country1.onchange=function() {
if(Country1.options[Country1.selectedIndex].text=="None"){
for(i=1;i<6;i++){
State1[i].style.display='none';
}
}
if(Country1.options[Country1.selectedIndex].text=="Pakisthan"){
for(i=1;i<3;i++){
State1[i].style.display='none';
}
for(i=3;i<6;i++){
State1[i].style.display='block';
}
}
if(Country1.options[Country1.selectedIndex].text=="India"){
for(i=1;i<3;i++){
State1[i].style.display='block';
}
for(i=3;i<6;i++){
State1[i].style.display='none';
}
}
}
</script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.