Hello ,
I have 2 field .
1) Drop Down Field : With some values , A,B,C.
2) Simple Text Field (Single Line).
I have all 3 screens same for a issue type (view/create/edit).
Now I want whenever I create the ticket.

Based on drop down Value It must set/change the text field value dynamically . Not after Pressing the create button .
I have create script post function in create transition.

Here is my code written .
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def country = customFieldManager.getCustomFieldObjectsByName('Bayer Lead Country')[0];
def currency = customFieldManager.getCustomFieldObjectsByName('Billing Currency')[0];
//def myTestField = customFieldManager.getCustomFieldObject(10024);
def countryvalue = issue.getCustomFieldValue(country)
log.warn(countryvalue)
if(countryvalue == "A") {
log.warn('if loop')
issue.setCustomFieldValue(currency,'EUR')
}
else if(countryvalue == "B") {
log.warn('china loop')
issue.setCustomFieldValue(currency,'CNY')
}
else{
log.warn('error')
issue.setCustomFieldValue(currency,'error')
}.
Please help me to acheive it dynamically over the create screen .
Also this code Always goes to else and set the value as error after clicking on create button