What am i doing:
I am trying to create a dynamic form that will fetch data from an API and will display the values as the user use the form. Eg: A user selects a list of services -> It lists the all the available values from the above service -> And continues further based on the what the user is selecting.
I have so far been able to:
1. Created a single choice custom field.
2. Created a single select field for listing the values from the choice of service selected.
3. Set a behavior that points to the #1 field and set the target field(#2) with the values.
4. Able to list the values in the form
I have not been able to do so far:
1. Not been able to read the values from step #2 of I have so far been able to
2. While reading the above value, the value is represented as null
3. Value from the log
```
2023-05-09 15:48:30,859+0000 https-jsse-nio-8443-exec-5 url: /rest/scriptrunner/behaviours/latest/jsd/jsd/runvalidator.json; user: xxxxxxxxxxxx WARN xxxxxxxxxxxxxxx 948x80780x1 siy15h 15.65.252.11,172.17.99.83 /rest/scriptrunner/behaviours/latest/jsd/jsd/runvalidator.json [c.o.scriptrunner.runner.ScriptBindingsManager] currentField Form field ID: customfield_10940, value: null
```
3. My code
```
import com.atlassian.jira.component.ComponentAccessor
// Define Managers
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def optionsManager = ComponentAccessor.getOptionsManager()
def currentField = getFieldById(getFieldChanged())
def currentselectedOption = currentField.getValue() as String
log.warn("currentField ${currentField}")
```
Thanks in advance and please let me know if you need any other info.
Regards,
Niraj