Customize the behaviour of a multicheckbox field

Hi everyone,

I'm quite new on the Jira developer environment, and still not sure about how to do some customization. I'm trying to write a script to customize the behaviour of a multicheckbox field.

I would like to realize a behaviour like the follow.

Option 1

Option 2

Option 3

Option 4

If "Option 1" is selected you can select just "Option 2". If "Option 3" is selected you cannot select "Option 1" and "Option 4" but you can select still "Option 2".

I was reading this question but I'm quite new of jira and I don't know javascript. I created the custom field I need with all the related options, I installed "behaviours plugin" and "script runner". I think that behaviour plugin is what I need. I wrote the following code to bind the Create issue

"AJS.$(document).bind('dialogContentReady', function(event, dialog) {

//do nothing


but now how I can customize the options "checked/unchecked" or "enable/disabled" of my field?

2 answers

1 accepted

1 vote
Accepted answer

In the end I found a solution. I will do a short introduction for beginners like me about what I did.

It is possible to modify the behaviour of fields adding javascript in the "description" of a customfield.

To do scripts you use AJS (Atlassian Java Script) that uses the syntax of jQuery and some some special function (AJS Helper Functions).

A useful tool to try the scripting behaviour is the Sandbox, and also the "developer tool" of Google Chrome is a useful object.

This code in the end does what I need

<script type="text/javascript">

AJS.$("#customfield_10106-5").change(function() {

var all= AJS.$("#customfield_10106-5").is(':checked');








AJS.$("#customfield_10106-1").attr("disabled", true);

AJS.$("#customfield_10106-2").attr("disabled", true);

AJS.$("#customfield_10106-3").attr("disabled", true);

AJS.$("#customfield_10106-4").attr("disabled", true);

AJS.$("#customfield_10106-6").attr("disabled", true);

AJS.$("#customfield_10106-7").attr("disabled", true);




AJS.$("#customfield_10106-1").attr("disabled", false);

AJS.$("#customfield_10106-2").attr("disabled", false);

AJS.$("#customfield_10106-3").attr("disabled", false);

AJS.$("#customfield_10106-4").attr("disabled", false);

AJS.$("#customfield_10106-6").attr("disabled", false);

AJS.$("#customfield_10106-7").attr("disabled", false);




I got that another simply way to achive what I need is to use javascript code in the section "Description" of my custom field. But i cannot understant how to know if the options of a multi checkbox are checked or not. How can I get back the value of an option of my field?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,095 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