How can we make a custom field non editable manually, it can only be edited through workflow
Asked by a855031:

I am trying to make a custom field non edible by members of the project it can only change its value by the formula in workflow


Answers:
author: Joe Pitt
body: Remove it from the create and edit screens and leave it on the view screen. If you only have one screen you'll need to create at least a view screen in the project.


author: Vijay Shanmugam
body: Hi [@a855031](/t5/user/viewprofilepage/user-id/5558834) ,

You can make the field as Read only using the Scriptrunner Behaviors feature.


author: Heenaben Sardarbhai Chaudhary
body: hi [@a855031](/t5/user/viewprofilepage/user-id/5558834) ,

In Jira, field-level permissions (like making a field non-editable by users) are not directly supported out of the box. However, you can achieve this with a combination of workflow configuration and possibly custom scripting. Here's how you can handle this situation:

### 1. **Use Field Configuration and Screens** {#toc-hId--2146683435}

You can configure field visibility and editability through field configurations and screens, but this approach has limitations:

* **Field Configuration**: You can set a field to be "Required" or "Optional" but not to be editable in specific contexts. You would typically make a field hidden or visible based on the screen configuration.

* **Screens**: Configure the screens used in the workflow transitions to include or exclude the field. For example, you can create a screen for transitions where the field is not displayed, effectively preventing users from editing it during those transitions.

### 2. **Utilize Workflow Validators and Conditions** {#toc-hId-340829398}

You can add workflow validators or conditions to ensure that the field's value is managed as desired:

* **Validators**: Add a validator to the workflow transition to check the field value or ensure it meets certain criteria. This can prevent users from changing the field's value in an unwanted way.

* **Conditions**: Use conditions to control the visibility of workflow transitions based on user roles or other criteria.

### 3. **Custom Scripting with Jira Apps** {#toc-hId--1466625065}

If you need more advanced control, you might consider using Jira apps like ScriptRunner, which allows for more complex scripting and automation:

* **ScriptRunner**: Use ScriptRunner or similar apps to create scripted fields or workflow post-functions. You can script the behavior such that the field value is automatically set based on a formula or other logic during specific workflow transitions.

* **Behaviors** : In ScriptRunner, you can use "Behaviors" to make fields read-only based on certain conditions.  

  Since Jira doesn't support field-level security directly, combining field configurations, screens, workflow validators, and custom scripting is often necessary to achieve the desired outcome. If you're using Jira Cloud, automation rules might also provide a solution.


author: Trudy Claspill
body: Hello [@a855031](/t5/user/viewprofilepage/user-id/5558834)

What options have you tried so far? And what has been the outcome of those methods?

Jira does not provide field level security to enable you to set permissions such as Edit or View per field.

Can you tell us more about your scenario? Can you show us the workflow where you are currently editing the field, and the formula you are using? If we have a full understanding of your scenario then we may be able to provide more relevant advice.


Tags: cloud

jira-cloud