Forums

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

Scriptrunner Behaviours - Default Value bug Issuetype

it_marcapo June 26, 2019

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:

  1. Select a Project
  2. Click "Create"
  3. Choose correct issuetype1
  4. The default values will be filled in as expected
  5. Change issuetype to any other type for example issuetype2.
  6. 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!

 

1 answer

0 votes
Payne
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.
June 26, 2019

I don't think it's a bug, but rather Jira expected behavior. Even without a Behaviour, if you change the selected project and/or issue type, the summary, description (and likely any other shared fields) remain populated. I see that as desired behavior, in that if I take the time to type an elaborate description and then realize that I chose the wrong issue type and change it, I'd be bummed to see my description disappear.

it_marcapo June 27, 2019

If that is an expected behavior then there should be an option for disabling that.

Cant imagine that nobody else run into these trouble.

Any other possible solutions for this case?

Like Iulia Muraseva likes this

Suggest an answer

Log in or Sign up to answer