We want to set default values with help from behaviours(scriptrunner) for an systemfield.
Here an example Code:
def desc = getFieldById("description")
def defaultValue="*Test*\n"
if(!desc.getValue())
{
desc.setFormValue(defaultValue)
}
That works fine until you get in the following example:
- Select a Project
- Click "Create"
- Choose correct issuetype1
- The default values will be filled in as expected
- Change issuetype to any other type for example issuetype2.
- The default values from issuetype1 stay filled in the fields.
Not a real Workaround:
If i remove the default values after stepp 6 and click outside the form it correctly show the defaults for issuetype2 or if not defined let the field empty as expected.
How can we solve this problem?
The same problem appears when i try to set default values with the field configuration shown here:
https://confluence.atlassian.com/jirakb/how-to-set-default-value-for-summary-field-in-jira-800692650.html?_ga=2.251129734.1844592469.1561555075-925990356.1558690194
Is there any other solution for this problem? Or is this just a bug in scriptrunner?
Pls DONT recommend any other paied plugins, that wont help people.
Thanks a lot!