Hi,
We are planning to migrate jira4.4 to jira5.X in our organisation. we have implemented some of the customized functionality on custom fields through javascript. our script is working fine in jira4.4 but its not working in jira5.x. we have tried the below sites information but still not able to get the solution for this.
https://developer.atlassian.com/display/JIRADEV/Custom+Fields+that+use+CSS+or+JavaScript+Web+Resources+in+JIRA+5.0
https://answers.atlassian.com/questions/47843/strange-javascript-problem-in-create-screen
We would like to know is there any feature in Jira 5.x where the UI works like Jira 4.4. Can we acheive this by configuring any parameter in Jira 5.x.
Could you please suggest the solution for this.
try with following code if the first alert came then you need to check your logic
<script type="text/javascript"> jQuery(document).ready(function($) { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) { callFunction(); }); callFunction(); function callFunction(){ alert("Test by Rambanam"); $('#customfield_12661').focus(function(){ onFocusFunction(); }); } function onFocusFunction(){ alert("in onfocus function"); var testdefect = document.getElementById("customfield_12660"); var w12 = testdefect.selectedIndex; var testvaldefect = testdefect.options[w12].text; var Maharashtra={"Select List": "-1", "Pune": "17890" ,"Nasik":"17158"}; var Karnataka = {"Select List": "-1", "Hubli": "17159" ,"Banglore":"17160"}; var phase={"Maharashtra": Maharashtra ,"Karnataka": Karnataka}; var value = new Object(); value = phase[testvaldefect]; var count=0; defectIdval.innerHTML = ""; for (var i in value) { defectIdval.options[count] =new Option(i,value[i]); count++; } } }); </script>
I hope you find the below links useful -
https://answers.atlassian.com/questions/27160/how-do-you-embed-javascript-for-a-custom-field-in-jira-5-x
https://answers.atlassian.com/questions/71288/custom-field-javascript-migration-from-jira-4-4-to-5-1
Jaya singh,
Threre is no way to configure any parameters to work javascript in 5.x as in 4.4 because the UI changed lot from 4.x to 5.x, so you have to change your script according to the 5.x UI
I added lot of javascripts on 5.x as specified in the following post and all are working fine,
Hi Rambanam ,
I have javascript which works when i place it in the announcement banner but it does not work when i embed it in a web resource plugin . Can you please help
refer my question here
Hi Rambanam,
We have tried two scenario using plugin1. Added web resource in atlassian-plugin.xml, Added JIRA.Events.NEW_CONTENT_ADDED and ajax based javascript inside the js file, removed javascript from field configuration. after installing this plugin we are getting the output as below:Output: At the time of issue creation ,when we clicked on Create Issue Link, it is opening new page same as old version of JIRA 4.4, we are able to see all the projects in the project dropdown and in the issue type dropdown we are getting all the project specific issue types.Dropdown functionality was working fine. But dropdowns w.r.to Dashboard, Issues, Project is not working. They are in disabled mode 2. Added web resource in atlassian-plugin.xml, Added JIRA.Events.NEW_CONTENT_ADDED and ajax based javascript inside the js file as well as in field configuration.Output: At the time of issue creation, we are able to see all the projects in the project dropdown and in the issue type dropdown we are getting all the project specific issue types
Thanks,
Jayasingh.
can you share your code in js file and check that is there any error throwing javascript using firebug on firefox or javascript console on crome
Hi Naren,
I have tried many alternative ways but still no luck :-(
Jayasingh
Thanks for your help.
I have tried this code but once i log out and login again the alert was not working for the first time. Second time its working fine.
on which screen you tried and where you added javascript? i mean in plugin or field configuration?
I have created a custom field named state and city. In city custom field i have added this script inside field configuration. I havent used any plugin.
It looks like you're new here. Sign in or register to get started.