Hello,
I am new to jira scriptrunner/groovy... I am trying to use "Behaviour/Initialiser Function" from script runner to load dynamic descriptions to edit issues screen based on some custom field values. All but one field is located on the edit issue form. One is located on the view issue form. Currently my problem appears to be that I can't seem to grab ANY field values which is very frustrating.. I have been trying a lot of different variations in syntax to to accomplish this goal.. None have been successful. Below is my current script.
/****************BEHAVIOR-INITILISER FUNCTION SCRIPT****************/
//View issue screen (#issue-content) single value text fields
def FV1 = getFieldById("customfield_10175").getValue()
//Edit issue screen (#edit-issue-dialog) single value drop-down fields
def FV2 = getFieldById("customfield_10128").getValue()
def FV3 = getFieldById("customfield_10162").getValue()
def FV4 = getFieldById("customfield_10169").getValue()
def FV5 = getFieldById("customfield_10151").getValue()
def FE1 = getFieldById("customfield_10156")
def FE2 = getFieldById("customfield_10131")
def FE3 = getFieldById("customfield_10127")
def FE5 = getFieldById("customfield_10185")
def FE6 = getFieldById("customfield_10154")
//Edit issue screen (#edit-issue-dialog) input text field
def FE4 = getFieldById("customfield_10153")
if (FV1 != null && FV2 == "RTN" || FV2 == "NG" || FV3 == "RTN" || FV3 == "NG" || FV4 == "RTN" || FV4 == "NG" || FV5 == "RTN" || FV5 == "NG") {
FE1.setDescription('test')
FE5.setDescription('test')
FE6.setDescription('test')
} else if (FV1 != null && FV5 == "OK") {
FE1.setDescription('test')
FE2.setDescription('test')
FE3.setDescription('test')
FE4.setDescription('test')
FE5.setDescription('test')
FE6.setDescription('test')
} else if (FV1 == null) {
FE1.setDescription('test')
FE5.setDescription('test')
FE6.setDescription('test')
}
Please help me understand what Im doing wrong... Im beating my head on a wall at this point.