Hello everyone
I have a custom field and set it to required via field configuration for this specific issue type.
The only time it should be optional is when the issue is being created since the value cannot be set at this time.
At the moment, I have the following initialiser in my behaviour.
//Set Summary
String year = new Date().format('yyyy')
def Summary = getFieldById("summary")
if(Summary.getValue() == null)
{
Summary.setFormValue("Zinsnachzahlung " + year)
}
//Make PK-Support optional on create issue screen
if (getActionName() in ["Create Issue", "Create"])
{
def PKS = getFieldById("customfield_11904")
PKS.setRequired(false)
PKS.setReadOnly(true)
}
What this looks like.

After clicking on create however.

Any idea on how else I could achieve this?
Thanks and best regards
Marius