I think I figured out how to fix this bug. It was complicated because different forms submit in different ways. On top of that, the value of checkbox inputs are set to the ID of the custom field. Even with that being said, I was able to modify some code I found on a forum to fix this issue. I tested it with multiple custom checkbox fields in both the Tickets and Tasks forms. It should also work with custom forms, but let me know if you run into issues.
Edit scp/js/scp.js
Line 702
Change
function(e) { submit_button = $(this); });
to
function(e) { submit_button = $(this); uncheckedPrep(); });
At the bottom of scp/js/scp.js add this:
function uncheckedPrep() {
$("form").submit(function () {
var form = $(this);
form.find('input[type="checkbox"]').each(function () {
var currentCheckbox = $(this);
// Hides all checkboxes before submit to avoid confusion of all checkboxes looking checked
currentCheckbox.hide();
if (currentCheckbox.is(':checked') == false) {
currentCheckbox.prop('checked', true);
currentCheckbox.attr('value', '0');
}
});
});
}
uncheckedPrep();
Update: I submitted the bug and fix to osTickets Github (https://github.com/osTicket/osTicket/issues/4782)