Hello,
I am trying to set the description field to read only, when a specific workflow happens, and switch it back, when another workflow step occours.
I tried the following code with Scriptrunner Workflow functions. I do not see any errors in the History, but it still does not work, the description field stays editable.
import com.atlassian.jira.issue.IssueFieldConstants
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
final String fieldName = "description"
getFieldById(fieldName).setReadOnly(true)
Help is greatly appreciated.
Regards
Hi @Patrik ,
If you call the description field like that, it returns a string (the content of the description), and you can't make that read only.
However, there is another way to tackle this with a behaviour instead of a workflow function:
Strangely enough it will look like the description field is still editable in the issue view (the pencil is still there), but it is not if you try to edit it.
Hope this helps!
- Tessa
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.