Hi Community,
I have created a custom Checkbox field present on Parent issue in Jira data center.
I want to set this Checkbox field in ReadyOnly mode, if Sub-tasks are created and linked to Parent issue on a particular status.
If there are no such Sub-tasks created/ linked with the Parent issue on a particular status, then the Checkbox field should be Editable.
Please guide on how we can configure the above use-case using scriptrunner, jira automation, or jmwe app.
Thanks
Your requirement is pretty straightforward. You will need to create a Server-Side Behaviour for the checkbox field and set the condition to is so it will read-only if the field contains sub-tasks.
Please refer to this code snippet for a working sample code.
Below is the code from the code snippet for your reference:-
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScriptFieldBehaviours behaviours
def sampleCheckbox = getFieldById(fieldChanged)
sampleCheckbox.readOnly = false
if (underlyingIssue.subTaskObjects.size() > 0) {
sampleCheckbox.readOnly = true
}
Below is a screenshot of the Server-Side Behaviour configuration:-
I hope this helps to solve your question. :-)
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.