Hi All,
I have a form and there is a custom field called request type and this is a select list. Select list containes some values as [ test, project, defect]. if i save form as selecting defect from list this custom field supposed to be readOnly and shouldnt be updated.
I tried some code and managed to make field readonly, But in edit mode when i change request type form test to defect without saving the form this filed become immediately readonly. I need to make it work after saving the form.
if (getAction()?.id == 1)// Do not make field readonly on Create mode
{
return
}
def CustomField_ = getFieldByName("Request Type")
def selectedOption = CustomField_.getValue() as String
def isOtherSelected = (selectedOption == "Defect" )
CustomField_.setReadOnly(isOtherSelected);
Hi @Sema YILDIRIM ,
an easy way to prevent users from editing certain fields is to
Cheers
Thorsten
Hi @Thorsten Letschert _Decadis AG_ ,
where is it "Edit operation"? I can prevent it from being read only in the creat section. But how do I intervene in the edit section?
if (getAction()?.id == 1) // Do not run script on Create action
{
return
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sema YILDIRIM ,
sorry for having been too quick with my initial response. With regard to your use case, I've been successful in the past by adapting the solution provided by Joshua here: https://community.atlassian.com/t5/Jira-Service-Desk-questions/Can-t-hide-Comment-field-on-Edit-screen-using-methods-provided/qaq-p/676381
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Sema YILDIRIM if no other fields need to be updated later then you have 2 options:
Best,
Fadoua
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.