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

3


03 Sep, 2019
confluenceUser
confluenceUser
05 Sep, 2019
confluenceUser
confluenceUser

In this case perhaps you could use your own custom URL to return your own custom JSON eg make use of a Web Service Plugin to serve the custom JSON.

05 Sep, 2019
confluenceUser
confluenceUser

Anders  well, that is what i wanted to ask that from json if i call a webservice, how can i pass a parameter? because the value goes a string as it is from json. is there some sort of a specifier which can tell json to pass the value of that field. 

appreciate your help. 

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print