Script Tags in Field descriptions not working in Create/Edit Dialog boxes

In previous versions of JIRA (4.4.4 and earlier) script tags could be included within the description of a field. One example use of this would be to hide/show a one field (e.g. Priority Explanation) based on the value of a previous field (e.g. priority = Critical).

Since upgrading to JIRA 5.1.4, it appears that the script tags (and its contents) are stripped from a description of a field when rendered in the new create/edit dialog boxes. However, when using the CreateIssue.jspa page to enter issues, the script tags are rendered and therefore function as expected.

Is this by design? If so is there any recommended work around?



3 answers

1 accepted

0 votes
Accepted answer

Yes and no!

After some discussion with Atlassian support, during which they were unable to identify (or recreate) the problem, a screen sharing session was arranged.

During the session I was able to demonstrate the problem to Atlassian on 2 different browsers (IE & Chrome). All the admin settings for fields, screens and projects were checked and seemed to be configured correctly, the indexes were cleared, JIRA was restarted and the browser cache was flushed in Chrome with no effect.

Finally, a new field with the same settings (but different name) was created an added to all screens. A second refresh of the cache was performed and the new field and the existing field began to work! The new field was then deleted, the cache refreshed for a third time and the problem has gone away.

Atlassian have chalked it up to a browser cache or index problem - three weeks on the problem has not reappeared!?!?!?!?!

Wow really!! Ok, I'll give that a try

Hi Colin

We did subsequently experience a problem which we (wrongly) immediately assumed to be the same problem recurring. It turned out that one of the Field Configurations had a different description for the field which didn't include the script so that may be something worth looking at too!

Good luck!

Is this self-hosted jira? If so are you sure they're getting stripped - possibly they are just getting executed too early. Can you paste an example of one of your scripts?

Hi Jamie

Yes I am using a self-hosted jira, but as I am not using a Custom Field plugin I hadn't looked at the developer notes during the preparation for the 5.1.4 upgrade :(

Here's how my custom field (id = 10030) is configured (via the Custom Fields page in the JIRA Administration section):

  • Field Type: Free Text Field (unlimited text)
  • Field Name: Priority Explanation
  • Description:
    Please provide an explanation when selecting a priority of <em>Critical</em>.
    <script type="text/javascript">
    	var priority = AJS.$('#priority');
    	if (priority) {
    		var priorityExplanation = AJS.$('#customfield_10030');
    		// Hide the target field if priority isn't critical
    		if (priority.val() != '2')
    			var priority = AJS.$('#priority');
    			var priorityExplanation = AJS.$('#customfield_10030');
    			if (priority.val() == '2')
    			} else {

On the classic Create Issue page (/secure/CreateIssue.jspa) the Javascript works and can be seen by viewing source or inspecting the elements!

On the new Creat/Edit dialog boxes, the Javascript does not work nor is it viewable in the page source or by inspecting the elements!?!?

Thanks for any help you can provide!


Ian did you find any more info about this?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,708 views 17 21
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