Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Set fields to read-only after create screen for some groups

Sander Spoelstra January 22, 2019

Hi, 

Currently, I've limited the edit options for some user groups. They can create an issue but never edit the ticket. However, I would like some fields to be editable yet others not to be. How can this be done?

I've tried using behavior, but if you set some field for a group to readOnly, it becomes readonly when creating the ticket as well. So now, I'm trying to set up a script to get this working for me in combination with the standard condition options in behaviors:

Behavior.png

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.customfields.option.LazyLoadedOption;

//Setting some fields to non-editable
def customField1 = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_13803");
if (getFieldScreen().name != "Axon Delivery - create") {customField1.setReadOnly(true)}

 

1 answer

0 votes
Sreenivasaraju P
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 23, 2019

Hi @Sander Spoelstra,

You use jira workflow transition for updating field values instead of using Edit operations. Using condition you can restrict the transition to certain groups only.

Sander Spoelstra January 23, 2019

Actually, I'm really trying to avoid any unnecessary transitions as they clog up the flow. So if there is a way with behaviors / scripts that would be very helpful.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events