Hi,
I have a big checkbox field (multi-select) and i wanted to know if it's possible to put the values of the field on two columns.
The field on the screen:
What i want it the same thing but with two columns of values, so that the field will take less space on the screen.
I'll be glad to hear any information regarding this :)
Regards,
Laurent
Hi Laurent,
There is a long history of people wanting this functionality. See below! :) Hope it helps.
If you don't feel like reading through all the comments. Here is the code. Make sure to change customfield_ID
<script language="javascript">
AJS.$(document).ready(function(){
Array.from(document.body.getElementsByClassName("checkbox")).forEach(function (cbox) {
if (cbox.getAttribute('name')=='customfield_#####') {
cbox.parentNode.style.cssFloat='left';
cbox.parentNode.style.width='20%';
}
});
});
</script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Britanny,
I've been through the thread and the solution seems to work !
But i'm barely starting to get comfortable with scriptrunner and i'm not a dev. I have absolutly no idea where i can put those lines !
On the thread, those lines are in the description of the field. Is it where i should put them ? (Kind of a hacking technique to inject code somewhere ?)
Anyway, thank you very much for your answer !
Regards,
Laurent
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My bad, it's specified in the thread that the JS should be added to description !
Thank you again !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There's no way to do this natively.
You could try to find or write an add-on that provides the same field, but with a different layout (I've had no luck finding one), or you could try injecting javascript to re-arrange the screen, but that can be very painful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
Seems that is what is described on the previous answer !
Thank you for your anwser !
Regards,
Laurent
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again,
Actually the injection suggested above works but only on none scripted screen. I name a none scripted screen, a screen with no behaviour associated to the fields in it.
It seems that the behaviour prevent Jira from looking in the description of the field.
Have you an idea how can i get both Behaviour and javascript injection work at the same time ?
Regards,
Laurent
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Laurent,
Sorry for the late reply. Let me look into that for you and get back. @Nic Brough -Adaptavist- Do you know about how this could be fixed?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again,
@Brittany Wispell I'm still watching this in case you find something.
Thank you for your help so far :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again !
I found the solution ! It had nothing to do with Scriptrunner and behaviours.
It was only an issue of field configuration scheme.
I detailed it a bit more here :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online 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.