Alternative for javascript - html button

In our current JIRA (v4.4.5) we are using javascript in the description of a textfield. The field contains a reference to a directory on our local file system. The javascript is used to display pushbuttons to

- create the project directory automatically on the local file system.
- browse to the directory --> opens an explorer window.

Since we consider an upgrade, I'm testing a more recent version, where javascript is no longer supported. The javascript code gives strange effects: when viewing an issue, the screen becomes blank and only the buttons are shown. (seems like the javascript code replaces the entire JIRA-issue-detail-page). When I delete the js-code, everything works fine.

Does anybody had the same problem? Or are there alternatives to provide these browse & create feature in a newer JIRA?

Thanks,
Gerd

1 answer

We can't say anything without looking at the JS. Would you be able to show us the code?

Perhaps your virus scanner may be blocking the JS, as it performs its operations on the local filesystem. (security violation)

Hi,

I reduced the javascript, to provide a simple example:

<script>

function openFolder() {
   folder = document.getElementById('customfield_11601').value;

      window.open(folder);
}


document.write('<input type="button" value="Browse" onClick="openFolder()">');


</script>

Regards,

Gerd

I suggest that you write these scripts using AJS/Jquery instead of plain JavaScript. Also, please check if it works after you inseart a slash (/) right before the last angle bracket here:

document.write('<input type="button" value="Browse" onClick="openFolder()"/>');

Hi, the extra slash at the end doesn't make a difference.

Do you know if it is still possible to add a html button to the description of a custom textfield in the newer JIRA? I'm afraid that - even with jquery it won't work...

Thank you!

That's strange. Because you are trying to create a button inside a div it should work. Did you check on different web browsers?

Hi, I wasn't able to work on this issue for a while...

I checked on Firefox, IE and Chrome... none of them shows the button correctly.

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
Posted Wednesday in Jira

Join our webinar: How 1B+ feature flag events helped us build the new Jira

Every time you release software, there's a bit of risk – that there's a bug, that something breaks, or that the feature doesn't resonate with customers. Feature flagging helps make high stakes s...

130 views 0 3
Join discussion

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