Hello,
I want to 'read only' field fixVersion in Jira.
In edit screen in is working okay, But in view screen it is not read only and users can edit it.
I tried to use this intialiser without success:
def customField = getFieldByName("Fix Version/s")
customField.setAllowInlineEdit(false)
What am I doing wrong?
Thank you,
Daniel
Ahh I get it now. Just remove the field from the edit screen that will make it read-only. No need for behaviours :)
But you don't want people to edit it so why keep it on the edit screen? As far as I can tell from your description, fixVersion is set upon creation and shouldn't be edited after? If so fixVersion should only be on the view (so you can view it) and create screen (so you can set it upon creation), not on the edit screen (since it shouldn't be edited). That is the way to go :) Even if you could do it differently the result would be the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have a condition on this field, only users from a specific group can edit it.
So, I need it in edit, in create and in view screens.
But in View screen, the script didn't work, and all of the users can update it....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see. Then you should be able to add the field to your behaviour, make it Readonly and add a new condition for a certain role or user like so :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did it, like I wrote from the beggining...
It is working great only in edit screen, not in view screen.
In view screen all of the users can edit this field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm wierd. Works fine here. I see the edit if i hover over the field, but i can't actually edit it..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mathis Hellensberg you only have to add the field in the behaviour. That forces the edit screen to pop up when you try to inline edit it.
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.
No, I still can change FixVersion value from view screen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dan27 Hmm.. can you post the full behaviour script? :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
def customField = getFieldByName("Fix Version/s")
customField.setReadOnly(true)
OR
def customField = getFieldByName("Fix Version/s")
customField.setAllowInlineEdit(false)
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.