Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Get issue key of link 'is Feature of Epic' using announcement banner (javascript)



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 ={return});
var actions = AJS.$(row).find('td.issue_actions');
AJS.$(actions).before('<td class="nav">' + value + '</td>');



What am I doing wrong?

Thanks ,


1 answer

0 votes

I'm not going to ask why you are doing this or why you tagged your post with scriptrunner or adaptavist ... but let's see what we can find out is going on with this script.

The first thing that seems odd to me is this:

var actions = AJS.$(row).find('td.issue_actions');

"row" is not defined anywhere. 

And in modern versions of jira, I don't see any td element with issue_actions class as specified by find('td.issue_actions').

My guess is that you want to somehow display the fixVersion of your liked issue in some way next to the status and priority. Those are not in a table or td (at least not in my jira 8.11).

My suggestion would be to try to add it after the link-summary

Try something like this (also leveraging some jquery to remove some of the for loops)

<script type="text/javascript">
AJS.$(document).ready(function() {
setInterval(function () {
var project = AJS.$("#project-name-val").text().trim();
if (project == 'WLA WorkBacklog' || project == 'WLA Solution Intent') {
AJS.$('dl.links-list dt[title="is Feature of Epic"]').next('dd').find('').each(function(){
var link = AJS.$(this);
var url = AJS.contextPath() + '/rest/api/latest/issue/' + link.text() + '?fields=fixVersions';
AJS.$.getJSON(url, function(data){
var versionName ={return});
link.closest('p').after('<p style="text-align:right;">'+versionName+'</p>');
}, 500);

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you