Hi everyone, I am developing a custom field plugin for Jira. I want to use my custom fields with ScriptRunner's behaviour feature. The problem I met as follows;
For instance I have a custom field named "myField" which is a single select type custom field and it appears on the issue creation screen. I build a server side script to follow my logs. When I open a issue create screen and change "myField" option, the stored value of my field returns empty. Furthermore, It does not even return null when there is noting selected yet. However, when I click create button without filling required fields and then getting errors for those fields which have to be filled, my fields value changes correctly and appears in my log.
In short, what I mean is, my field's value is not updating without any action in screen. In order to cope that, should I modify my edit.vm or should I add something in my java code?
I left my script code and logs here;
import org.apache.log4j.Level
import org.apache.log4j.Logger
Logger log = Logger.getLogger()
log.setLevel(Level.DEBUG)
def priorityField = getFieldById("priority")
def myField = getFieldByName("myField")
log.debug(myField)
def value = dropdownField.value
log.debug("value = " + value)
if (value == "some value") {
priorityField.setRequired(true)
priorityField.setHidden(false)
}
else {
priorityField.setRequired(false)
priorityField.setHidden(true)
}
Logs ;
Form field ID: customfield_10202, value:
value =
All kinds tips will be helpful.