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
Yet, I am unable to make it work.
Can anybody help?
I am using Jira Server v7.4.4
Thanks in advance
Roberto
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>
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to put it into the description of your custom field.
see screenshots in question as an example
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Roberto Arnetoli Hey, the script is causing the screens that contain this field to jam. Even through the settings I can not access it. What am I doing wrong? Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can anyone tell me if this will work in Jira/Cloud?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same for me.. does anyone knows how to make this work on Jira Cloud?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi! Any way to actually do this for the Customer Portal?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, visually this works great... however, by putting this script in, I can no longer bulk edit this field. Thoughts on how to make that possible without removing the script? Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.