Hello,
I would like to add fixversion of all links type 'is Feature of Epic'.
I wrote the script for adding the fixversion for 'issues in Epic' links.
How can I get the issue key of the 'is Feature of Epic' links using announcement banner?
I tried this code (without success):
<script type="text/javascript">
jQuery(document).ready(function($) {
setInterval(function (){
var editdl = AJS.$('.links-list')
var proj = AJS.$("#project-name-val").text();
var project = proj.trim();
if(project == 'WLA WorkBacklog' || project == 'WLA Solution Intent'){
var title = document.getElementsByTagName("DT");
for(var i=0; i<editdl.length; i++){
if(title[i].innerHTML == 'is Feature of Epic'){
var div = document.getElementsByClassName("links-list");
var nodelist = div[i].getElementsByTagName("DD").length;
for(var j=0; j<nodelist; j++){
var issueKey = div[i].getElementsByTagName("dd")[j].getElementsByClassName("issue-link link-title").value
AJS.$.getJSON(AJS.contextPath() + '/rest/api/latest/issue/' + issueKey, function(data){
var value = data.fields.fixVersions.map(function(version){return version.name});
var actions = AJS.$(row).find('td.issue_actions');
AJS.$(actions).before('<td class="nav">' + value + '</td>');
});
}
}
}
}},500);
});
</script>
What am I doing wrong?
Thanks ,
Daniel