Forums

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

Hide description depending on issue status

fr Behnk
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 30, 2019

Hi all,

I would like to hide the field "Description" when receiving a specific status.

After leaving the status, the "Description" should appear again.

I tried to write a Post-Function Script with ScriptRunner.

But I didn't find a possibility to change the attributes of the Description,

e.g. setVisible(false), hideField ....

I startet with something like that:

....

Imports....

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
FieldLayoutManager layoutManager = ComponentAccessor.getComponent(FieldLayoutManager)
FieldManager fieldManager = ComponentAccessor.getFieldManager()
FieldLayout fieldLayout = layoutManager.getFieldLayout(issue)

EditableFieldLayout editableLayout = layoutManager.getEditableFieldLayout(fieldLayout.getId())


// Get fields
FieldLayoutItem fieldLayoutDescription = fieldLayout.getFieldLayoutItem("description")

.....

Does anyone have an Idea?

Regards

Friedrich

 

1 answer

1 vote
Nic Brough -Adaptavist-
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.
April 30, 2019

A post-function is (mostly) for updating data during a transition.  They won't hide descriptions on-screen (unless you actually delete the value of the description field)

I think you should move to "Behaviours", which allows you to hide fields.

Suggest an answer

Log in or Sign up to answer