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

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
Brittany Wispell Community Champion Oct 04, 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 Champion Oct 04, 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>

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

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

Thank you again !

2 votes

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.

Hi Nic,

Seems that is what is described on the previous answer !

Thank you for your anwser !

Regards,

Laurent

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 Champion Oct 06, 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? 

Hi again,

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

Thank you for your help so far :)

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

Meet the AUG leaders of Northern Virginia

@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....

124 views 4 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you