On a screen, put the values of the custom field on two columns

Laurent Bierge
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 4, 2017

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:

Capture.PNG

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

2 answers

1 accepted

3 votes
Answer accepted
Brittany Wispell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 4, 2017

Hi Laurent, 

There is a long history of people wanting this functionality. See below! :) Hope it helps. 

https://community.atlassian.com/t5/Jira-questions/SOLVED-Checkboxes-on-multiple-columns-in-Jira/qaq-p/644822#M54072

Brittany Wispell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 4, 2017

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>
Like # people like this
Laurent Bierge
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 4, 2017

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

Laurent Bierge
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 4, 2017

My bad, it's specified in the thread that the JS should be added to description !

Thank you again !

2 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 4, 2017

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.

Laurent Bierge
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 4, 2017

Hi Nic,

Seems that is what is described on the previous answer !

Thank you for your anwser !

Regards,

Laurent

Laurent Bierge
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 5, 2017

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

Brittany Wispell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 6, 2017

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? 

Laurent Bierge
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 10, 2017

Hi again,

@Brittany Wispell I'm still watching this in case you find something.

Thank you for your help so far :)

Laurent Bierge
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 13, 2017

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 :

https://community.atlassian.com/t5/Product-Apps-questions/How-to-inject-javascript-when-behaviour-scriptrunner-is-used/qaq-p/651224#M36539

Suggest an answer

Log in or Sign up to answer