In AssetForms we have a number of field types that can dramatically extend the possibilities of AssetForms and allow you to connect your other systems and datasources right into AssetForms fields
These fields are
- Webservice checkbox
- Webservice checkbox group
- Webservice dropdown
- Webservice dropdown (advanced)
- Webservice multi-select
- Webservice radio group
We will setup a dropdown field that uses data provided by our other app, ConfiForms CLOUD
We will setup a web service connection to REST API for ConfiForms CLOUD and show the data from ConfiForms inside the AssetForms field
In ConfiForms app we have setup a form to store the data about our plugins
The form is pretty simple and contains 2 fields and just 6 records (yes, we do have 6 apps already on Atlassian Marketplace - check them out!)
- name - text field
- available - multi-select field to select where the app is available: server, data center and/or cloud
Now, we need to setup a connection to ConfiForms via REST API for ConfiForms CLOUD and generate the access token as documentation says.
We will need this token to setup a connection in AssetForms. Click on "Configuration"
Then click on "Webservices connections" tab
And add new connection
We use ConfiForms "Search API" endpoint and it looks like this (our form is called "apps" and it is located on the page with id "167739393"). We use no filter/query to get all the rows from ConfiForms form
So the result of this API call is the list of apps we have on the marketplace and what installation it supports: cloud, server, data center
When we are done with connection configuration we can start with setting up the asset type with a web-service field
We have created the following asset type
It has 4 fields as you can see and our "App" field is actually not a simple dropdown, but the one that is using the data from ConfiForms REST API and is configured as follows
We have selected it to be a "webservice dropdown" and have set up some mappings to get right fields into right places, see the result JSON file returned by ConfiForms API. We take the "entries" as a root element and we put "id" field's value from ConfiForms into the dropdown ID property and we take "fields.name" as a label
And that is it. The data managed in ConfiForms, but is used in AssetForms!
Then... we have extended our asset type as bit with Asset types rules and "Apply Filter" rule in particular to filter out from the choices those apps that are not available in cloud
Here is how we configured those rules
And the final asset type looks like this
That's it! Now you know the basics how to connect and configure external web services to be the sources for your AssetForms fields and how to map the data into the field.
As well, as how to filter data.