Hi,
I created a behavior to set a readOnly field depending abour value of an other field.
It's work ! There is an initialiser
"import com.atlassian.jira.component.ComponentAccessor
def N_BDC = getFieldById("customfield_10309")
def Charge = getFieldById("customfield_10205")
def ChargePrev = getFieldById("customfield_10207")
def ChargeReel = getFieldById("customfield_10208")
if (N_BDC.getValue() != "") {
Charge.setReadOnly(true)
ChargePrev.setReadOnly(true)
ChargeReel.setReadOnly(true)
}
else {
Charge.setReadOnly(false)
ChargePrev.setReadOnly(false)
ChargeReel.setReadOnly(false)
}"
then the script in server-side for the field
"import com.atlassian.jira.component.ComponentAccessor
import com.opensymphony.workflow.InvalidInputException
def N_BDC = getFieldById("customfield_10309")
def Charge = getFieldById("customfield_10205")
def ChargePrev = getFieldById("customfield_10207")
def ChargeReel = getFieldById("customfield_10208")
if (N_BDC.getValue() != "") {
Charge.setReadOnly(true)
ChargePrev.setReadOnly(true)
ChargeReel.setReadOnly(true)
Charge.setHelpText("les Charges ne sont plus modifiables car un bon de commande est renseigné")
N_BDC.setHelpText("la Charge n'est plus modifiable car un bon de commande est renseigné")
}
else {
Charge.setReadOnly(false)
ChargePrev.setReadOnly(false)
ChargeReel.setReadOnly(false)
Charge.setHelpText("")
N_BDC.setHelpText("")
}"
But if I add groupe or role condition ( when or except), script doesn't work anymore.
Can someone help me ?
Should I change my script ?
Should I include rôle condition in script ? How ? (I'm not developper)
Thanks