JavaScript on Custom Field Description of JIRA 6.4

Custom JS existing on description of custom field is simply showing as description on screens. Existing functionality was broken on Create Issue screens. Is there any workaround?

2 answers

This widget could not be displayed.

Remove JS from description and copy it as a JS file. Now call the custom JS file from announcement banner. it works.

Good approach. Exactly the same we did already since a few years and hence it - luckily - saved us during the update to JIRA 6.4.11 :-)

hi @srinivas

Looks like a promising solution. Can you please post an example of how I can call teh custom JS from announment banner?

I have the sample script here, which change sthe value of one custom field depending on other field's value. This once doesn't worked when the JS placed in Description.

"<script type="text/javascript">
appName = document.getElementById('customfield_14262');

target = document.getElementById('customfield_14261');


if (appName=="Bergen.Service) {
target.value = "bergen  service"

}
</script>"

 

 

This widget could not be displayed.
Boris Berenberg Community Champion Apr 14, 2015

We disabled this on purpose: https://confluence.atlassian.com/display/JIRA/Fields+Allowing+Custom+HTML+or+JavaScript You can use a plugin to deliver custom JS if you need to. 

Looks like the website was down so I am not sure what it was on the mentioned page. Can we enable this again? One question: Cant we use JS on any existing JSP pages or on Announcement Banner?

Boris, I tried many times but the site is down. Could you please point any other page if that was available?

Boris Berenberg Community Champion Apr 16, 2015

The site is not down, I just tested it. I would suggest trying to access it from a different connection? Or maybe something is busted with your Atlassian ID account, try viewing it in an incognito window.

Hi Boris, I am able to access the site on different browser. Could you please provide some more details about plugin to deliver custom JS?

We have custom JS on some of description fields, actually copies reporter user field value to some custom fields. Could you please suggest any workaround to achieve this functionality?

Boris Berenberg Community Champion Apr 17, 2015

You would need to write a standard P2 (not connect) JIRA plugin to inject Javascript. I am not familiar with the exact how to for this as I am not a dev, but I know this is how we deliver custom JS on some of our instances. The only workaround I have is to do this via post functions where you can, and write a custom plugin to inject JS where you can't.

Post functions does not help us since we need to call the JS on page load of Issue Create.

Boris Berenberg Community Champion Apr 17, 2015

This is what you would use to load JS: https://developer.atlassian.com/jiradev/jira-architecture/building-jira-add-ons/jira-plugins2-overview/jira-plugin-module-types/web-resource-plugin-module Some Googling around says https://marketplace.atlassian.com/plugins/de.communardo.atlassian.plugins.cute may also do this, but I don't know for sure. Would be important to trial and test first to see if it can help you inject the JS where you need.

Hi Boris, I got a simple work around. Now custom JS is also calling from announcement banner. I was not able to call JS on Create Issue dialog with the earlier versions from announcement banner but on JIRA 6.4 it is working. Thanks for sharing the links.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

257 views 5 0
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