Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

howto set cascading select field readonly?

Mathias Buchholz September 30, 2012

hello,

i created an cascading select field (ID "customfield_10500")

In opening screen the user should do a cascading select. After the issue is created the that field shouldnt be able to change its value.

- Could i set the field property via workflow properties ? (if yes, with which command?) (setting readonly or disable edit)

- i wrote a groovy script for a "Script Runner plug-in post-function".

customField.putAt("enabled", false)
customField.store()

that throws a groovy.lang.ReadOnlyPropertyException: Cannot set readonly property: enabled for class: com.atlassian.jira.issue.fields.CustomFieldImpl

--> editable is also readonly...

What could i do?

thanks

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Harry Chan
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.
October 1, 2012

Hi, you simply need to have the field available in the create screen and not in the edit screen if you wish for it to be set on create and not changed afterwards.

if you haven't already done so, best to create screens for: create, edit and view separately. Create a screen scheme with this set and assign it to the issue type you need.

From the screenshot it looks like you are using JIRA 5.1 which doesn't work with the Behaviour plugin. Script Runner also doesn't do anything like what you've described.

Mathias Buchholz October 1, 2012

Your right it is jira 51. On a certain way Behaviour plugin works that way. but only while workflow transistion not for issue edit.

your hint creating different screens for view and edit war usful.

strange that you cannot config a field as readonly...

0 votes
Mathias Buchholz October 1, 2012

i tried to use the Jira Behaviour Plugin.

setting a field to readonly while a transition... it is possble.

but how do i set the field readonly in the main screen?

(in the screenshot i still could change the content of the field)

using Javascript? How?

TAGS
AUG Leaders

Atlassian Community Events