Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hi,
If we want to add a checkbox that says “Approved”, once the box is checked, can we lock down all of the fields in the form so that they can no longer be edited?
How to achieve this? Please help.
Thanks,
Krithica
Scriptrunner Behaviour Plugin can help you in this case.
https://scriptrunner.adaptavist.com/4.3.1/jira/behaviours-overview.html
There are examples of making a field manadatory and hidden based on data entered on other field. You might need to tweak them to suit your case.
Writing javascript yourself is another way without using plugin.
Regards
Prakhar
I tried using behavior scripts. once the field is set read only again it is not editable even if all options are unchecked in checkbox.
I am using below script.
def checkboxesfield = getFieldByName("checkboxes");
def reqtypefield = getFieldByName("Request Type");
def team = getFieldByName("Team");
def selectedOption = checkboxesfield .getValue() as String
log.debug("checkboxesfield " + checkboxesfield .getValue())
if(selectedOption != "")
{
reqtypefield .setReadOnly(true);
team.setReadOnly(true);
}
else if(selectedOption == "")
{
reqtypefield .setReadOnly(false);
team.setReadOnly(false);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The catch here is with comparing the checkbox field values. It is not same as text field values. You can find some documentation here :
Regards
Prakhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't know of a way to exactly do what you describe, but I'd propose an alternative:
You could add to your workflow an extra "Approved" status and create a transition from the desired status fields and name it, e.g. "Approve". Furthermore, on the "Approved" status you would have to set the jira.issue.editable property to false, see the Atlassian docs for more details.
With this solution you would simply have an "Approve" button on each issue to achieve what you need.
Cheers,
Matthias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With workflow status property issue itself will become non editable. Based on the values in the field need to set other fields read only.
Checkbox= Checked for Yes--> then i want the fields to be read only. But i should be able to transition issues to next stages.
Checkbox = Checked for No -- All fields editable and should be able to perform workflow transition
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.