Populate custom field from external url connection

I have a requirement that i should show a drop down field which will have the values coming from an xml which is not on jira server ie I have to make a cross domail call. I have made a jsp which is on jira server and it is reading that url but this jsp is having the jira defualt codes as will (in view source i can see all other jira tags along with my data). My data is coming under the tag <section> :
<section id="content" role="main">
<node1>somevalue</node> <node2>some value</node></section>

I have to show these values in a drop down.I am using the jira version 5.2.4 How to do this ?

-Thanks

1 answer

Yes , i have to create a new custom field but it would be of which category. I have once used the CSV upload for making a drop down field but the problem with there is a problem with CSV that we have to update it on a monthly/weekly basis. So which custom field type can we use ?

I am also trying the below code for making a extenal url connection (have jira setup on my local machine ) but that is also not working.

<script type="text/javascript">
var fieldId = "customfield_10202";
function fieldOptions(data) {
console.log (data);
var currentValue = AJS.$("#" + fieldId).val();
var select = AJS.$("select#" + fieldId);
var foundIt = false;
select.append("<option></option>");
AJS.$.each(data, function(index, option) {
console.log(option);
if (option == currentValue) {
select.append("<option selected>" + option + "</option>");
foundIt = true;
}
else {
select.append("<option>" + option + "</option>");
}
});

if (!foundIt) {
select.append("<option>" + currentValue + "</option>");
}

AJS.$("input#" + fieldId).remove();
}

AJS.$(document).ready(function() {
alert("test1111");
AJS.$("#" + fieldId).parent().append("<select class='select' id='" + fieldId + "' name='" + fieldId + "'></select>");
AJS.$("input#" + fieldId).hide();
alert("test1");
AJS.$.ajax({
alert("test2");
url: "http://server.mysamplejsp.jsp",
success : function(Respxml){
alert("test4");
alert("data success"+Respxml);

}
alert("test2");
});
});

</script>

Not calling the fucntion but the alert itself are not coming.Please suggest.

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

17 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