I create a Text Field (read only) field and use it in a project. I should be only able to change the field via code. However I can still edit the field via the edit screen. What is wrong for me? How to make it truly read only?
You have to have two separate screens in the same screen scheme for this to work. One screen can be the View screen and the other can be used for Create and Edit.
One simple way to do it is to fins your screen in the list of screens in the Admin section, copy that screen and name it something like "<screen name> view-only screen", where <screen name> is the name of the original screen.
Then go to the project's screen scheme and associate the View issue operation with the new "...view-only screen".
Finally, configure the original screen to remove the field you don't want users to edit. If the field is non-empty you will see it when viewing the issue. But you won't be able to click-on it to edit it, and it won't appear in the edit screen.
If you need some help around the configuration part, this should point you there: https://confluence.atlassian.com/adminjiraserver/associating-a-screen-with-an-issue-operation-938847289.html
I got this to work using Script Runner, and did these steps:
Custom Field: Required Fix Date
Issue Type used: Bug
This field is to be read-only written from EXAMPLE project.
Go to Applications → Manage Apps → Behaviours (Left Nav bar)
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event