Custom JavaScripts in JIRA 5.1.3

Vishnukumar Vasudevan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 18, 2012

Guys,

I used to use the beow script in JIRA 4.4.1 to alter the visibility of a custom field based on another one.

<script type="text/javascript">
priority = document.getElementById('priority');
if (priority) {
target = document.getElementById('customfield_10061').parentNode;
// Hide the target field if priority isn't a Blocker
if (priority.value != 1) target.style.display='none';

priority.onchange=function() {
if (this.value == 1) {
target.style.display = '';
} else {
target.value='n/a';
target.style.display='none';
}
}
}
</script>

The above script doesn't work with JIRA 5.1.3. Do I need to change anything in the script ?

Thanks, Vishnu.

4 answers

1 accepted

0 votes
Answer accepted
Matheus Fernandes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 19, 2012

Perhaps is the same case as in this question: How do you embed JavaScript for a custom field in Jira 5.x

Or, this documentation in the Atlassian Developers site may help: How do you embed JavaScript for a custom field in Jira 5.x

Vishnukumar Vasudevan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2012

It works, sometimes doesn't. Anyway, thanks for the hint.

0 votes
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 30, 2012
0 votes
Vishnukumar Vasudevan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 18, 2012

Got it !!

It works when you create issue first time. It doesn't work if you use the new feature 'Create Anotther One' up on succession. The reason can be, new Jira doesn't reload forms but it just clear the forms for new issue creation.

Is there any workarround to fix this ?

0 votes
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 18, 2012

Is it not working while editing? None of this will work with inline edit for sure.

Vishnukumar Vasudevan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 18, 2012

It's not working even in the create issue screen :(

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 18, 2012

Is the javascript firing? Any error? Time for debugging ;)

Vishnukumar Vasudevan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 18, 2012

No, it doesnt fire any error.

Suggest an answer

Log in or Sign up to answer