Hi,
I need to made a text field 'read only' only in edit screen (The user can change this field in the edit and create screen).
BR,
Daniel
Um, your question says "make text field read-only in edit screen" then "the user can change this field in edit screen" - which one is it?
Or do you mean you just want to be able to stop all edits of the field after creation? (To do that, remove it from the edit screen)
I mean this:
In the create screen user can put value in this field.
In edit screen- user can change the value and update this field.
In view screen- the field will be read only (If the user wants to change, he will need to press the 'Edit' bottom).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, ok. You have a problem then - the standard way to tell Jira a field cannot be edited in "view" is to remove it from the edit screen. The "inline edit" is a friendly way of making Jira quicker and easier for your users - changing a field becomes three clicks instead of 6.
If you want to disable inline edit while keeping the ability to change a field then consider these:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Nic Brough -Adaptavist- ,
How can I do the third bullet? I can make a field 'read only' , but at all of the screens (view + edit).
I would like to 'read only' only in inline edit (view screen)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, use a Behaviour that is an "initialiser" and says
def descField = getFieldById("description") descField.setAllowInlineEdit(false)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
is possible to put a customfield in the transition but in only read, only in the transitions that I need, but in JIRA CLOUD, not in Server.
Thank's
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No. If you put a custom field on a transition screen, it is there to be edited by the user, not read-only. Behaviours can change that, but Cloud does not support the type of code Behaviours needs to inject to do this (yet), so there are no behaviours for Cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nic Brough -Adaptavist- behaviour seems to have an issue where the scripts kicks in rather slow. If you are fast enough to click the field <3 sec, the inline edit would still be available. :/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nic Brough - thank you for your involvement in the Community. With Jira 7.9.2 and Scriptrunner 5.6.9, I can't seem to disable inline editing on view screen, for a custom date picker field, using the simple 2 lines above with an initializer. It remains editable on view screen in the Dates section. Would you expect this to work for a date picker?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am also unable to get this to work on a simple text field.
def logField = getFieldById("customfield_10235")
logField.setAllowInlineEdit(false)
I am sure I am grabbing the right field as I have been able to get the setHidden() and setReadOnly() functions to work on it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am unable to get this to work as well. I have around 50 fields some of which are being made read only depending on the group a user belongs to. If he belongs to x group, he can edit otherwise he cannot. This functionality works perfectly fine in the edit screen but users are able to edit fields in view screen using inline edit.
This is a functionality we really need to get to work and disabling inline edit for the whole JIRA seems to be the only option we are left with (which is horrible) . Are there any other ways i can disable inline edit just for a single issuetype/ workflow. @Nic Brough -Adaptavist- @Joe Pitt
I tried using the setAllowInlineEdit(false) in the behaviour initializer. Does not work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you help me? Sorry, I couldn't run it. I made it readonly in Select List custom field custom options. But I don't want it to be read only when changing options on the edit screen.
if (getAction()?.id == 1)
{
return
}
def CustomField = getFieldByName("Request Type")
def selectedOption = CustomField.getValue() as String
def isOtherSelected = (selectedOption == "Defect" || selectedOption == "New Feature")
CustomField.setReadOnly(isOtherSelected);
If "Request Type" Defect or New Feature is selected, get readonly. Example "Request Type" Test selected. Later, when it is called edit, I do not want read only when Defect is selected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If they can edit the field then it isn't defined as read only. If you are setting it in the background remove it from the edit and view screens. If you don't have separate create, edit, and view screens you need to create them instead of just using the default screen for all functions.
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.
Can you help me? Sorry, I couldn't run it. I made it readonly in Select List custom field custom options. But I don't want it to be read only when changing options on the edit screen.
if (getAction()?.id == 1)
{
return
}
def CustomField = getFieldByName("Request Type")
def selectedOption = CustomField.getValue() as String
def isOtherSelected = (selectedOption == "Defect" || selectedOption == "New Feature")
CustomField.setReadOnly(isOtherSelected);
If "Request Type" Defect or New Feature is selected, get readonly. Example "Request Type" Test selected. Later, when it is called edit, I do not want read only when Defect is selected.
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.