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

SOLVED: Checkboxes on multiple columns in Jira Edited

Hi ,

I am trying show checkboxes on multiple columns in the create and edit forms of an issue using a script I found in a older question, but I am still unable to make it work.

The script that I am using is 

<script type="text/javascript">
(function($){
$(document).ready(function(){
$("input[name='customfield_10405']").parent().attr('style', 'float: left');
});
})(AJS.$);
</script>

and I am sure the customfield number is correct

Capture1.JPG

Yet, I am unable to make it work.

Capture2.JPG

Can anybody help?

I am using Jira Server v7.4.4

Thanks in advance

Roberto

4 answers

1 accepted

4 votes
Answer accepted

FINALLY!!

this is the JS to be added to the customfield description to have checkboxes on multiple columns

<script language="javascript">
AJS.$(document).ready(function(){
Array.from(document.body.getElementsByClassName("checkbox")).forEach(function (cbox) {
if (cbox.getAttribute('name')=='customfield_10405') {
cbox.parentNode.style.cssFloat='left';
cbox.parentNode.style.width='20%';
}
});
});
</script>

Capture.JPG

Hi Robert, can you please clarify where exactly the script has to be pasted? And, what about the double quotes in the script? Will they create problems during script eval? 

The above script is not working for me and it just gets added into a <p> tag in the page and doesn't get executed. Not sure what I am doing wrong.

You have to put it into the description of your custom field.

see screenshots in question as an example

Like Alena likes this

Hi @Roberto Arnetoli 

script works great on Jira and it looks as expected on create issue screen. However, do you have any idea how achive similar in the Jira service desk customer portal?

I have found that the following javascript or css applied to the create issue form source (using Fiddle) do exactly what I need:

var cbox = document.getElementsByClassName("checkbox");
for(var i = 0; i < cbox.length; i++) {
if (cbox.item(i).getAttribute('name')=='customfield_10405') {
cbox.item(i).style.cssFloat='left';
cbox.item(i).style.width='25%';
}
}
.checkbox[name=customfield_10405] { 
float: left;
width: 25%;
}

However, when I try to apply it to the Jira customfield, it does not work :-(

This is what I am adding to the customfield description:

<script language="javascript">
AJS.$(document).ready(function(){
var cbox = document.getElementsByClassName("checkbox");
for(var i = 0; i < cbox.length; i++) {
if (cbox.item(i).getAttribute('name')=='customfield_10405') {
cbox.item(i).style.cssFloat='left';
cbox.item(i).style.width='25%';
}
}
});
</script>

Any help on what to do?

thanks

I found that adding the following JS to the custom field description (replacing the for loop) has an effect on the right customfield, However it is still not doing what I need - it is actually moving the tickbox to the right and making it bigger but still in 1 column (see below).

What am I doing wrong?

<script language="javascript">
AJS.$(document).ready(function(){
Array.from(document.body.getElementsByClassName("checkbox")).forEach(function (cbox) {
if (cbox.getAttribute('name')=='customfield_10405') {
cbox.style.cssFloat='left';
cbox.style.width='50%';
}
});
});
</script>

Capture3.JPG

Can anyone tell me if this will work in Jira/Cloud?

0 votes

Same for me.. does anyone knows how to make this work on Jira Cloud?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

303 views 1 3
Join discussion

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