How to send value from JSON property to web service
Confluence User - 28 Aug, 2019
Hi,
I am writing a form element plugin. I am trying to make the edit configuration so that the user can configure the element before use.
SCENARIO:
test.json
[
{
title : 'TEST',
properties : [{
name : 'field1',
label : 'Field1',
type : 'textfield',
required : 'True'
},
{
name : 'field2',
label : 'Field2',
type : 'selectbox',
options_ajax_on_change : 'field1',
options_ajax : '[CONTEXT_PATH]/web/json/console/app[APP_PATH]/form/columns/options',
required : 'True'
}]
}
]
My java class calls this JSON file like:
@Override
public String getPropertyOptions() {
return AppUtil.readPluginResource(getClass().getName(), "/properties/test/test.json", null, true, null);
}
PROBLEM:
How can I send the field1 to field2 from the webservice been called in options_ajax property? How can i add the parameter to the webservice to send the value in that field to populate the other one. If I call webservice
URL: [CONTEXT_PATH]/web/json/console/app[APP_PATH]/form/columns/options?param1=field1.
field1 goes as a text not the value. How to send the value from JSON?
Any help will be appreciated.
Thank you.
plugins;api