Forums

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

How to set default values of label type custom field?

acoliver
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!
March 26, 2018

Hi Guys!

I would like to set default values in label type custom field.
If I want to create issue, then for all issue type i would like to get different values in label type custom field.

For example:
First attempt:

def iTypeField = getFieldById(getFieldChanged())
def myLabalCustomField = getFieldByName("MyLabel CField")
if ( iTypeField.getValue() == "Bug" ) {
myLabalCustomField.setFormValue(['bugfixing'])
}
if ( iTypeField.getValue() == "Story" ) {
myLabalCustomField.setFormValue(['master', 'release'])
}

Second attempt:
I tried to use your documentation:

https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/setting-default-fields.html#_setting_system_field_defaults

but i failed to do it.

 

Please help me, and thank you for your recommendation.

Kind regards,

Oliver

1 answer

0 votes
Fazila Ashraf
Community Champion
April 27, 2018

Hi @acoliver

I was looking to do the same and landed here from google results.

Checked further and found this bug with the adaptavist -> https://productsupport.adaptavist.com/browse/SRJIRA-1080 

So it is not possible to set field default on the label field

Thought of letting you know, in case..

Suggest an answer

Log in or Sign up to answer