Page tree
Skip to end of metadata
Go to start of metadata

This tutorial is a little bit more advanced than others and expects you to be familiar with the following areas

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 (smile)


Let's start!


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!)

Fields are:

  • 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

https://app.confiforms.net/rest/api/v1/search/<your_confiforms_app_access_token>/167739393/apps?q=


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

{
  "entries": [
    {
      "recordId": 1,
      "createdBy": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6",
      "created": 1587043364417,
      "id": "d80c6849-38b3-4a0a-b145-156f346dfaa5",
      "fields": {
        "name": "AssetForms for Jira",
        "available": "[\"cloud\"]"
      },
      "ownedBy": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6"
    },
    {
      "recordId": 2,
      "createdBy": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6",
      "created": 1587043382851,
      "id": "3495b0b3-0243-4ab0-a605-c6d14dd7d2df",
      "fields": {
        "name": "ConfiDoc. Viewer for SQL, XML, JSON, CSV",
        "available": "[\"server\"]"
      },
      "ownedBy": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6"
    },
    {
      "recordId": 3,
      "createdBy": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6",
      "created": 1587043402159,
      "id": "bd478f2a-a6bb-483d-884a-6188e1b32347",
      "fields": {
        "name": "ConfiForms. Data Forms & Workflows",
        "available": "[\"cloud\",\"dc\",\"server\"]"
      },
      "ownedBy": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6"
    },
    {
      "recordId": 4,
      "createdBy": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6",
      "created": 1587043420548,
      "id": "1efb8972-3047-4081-a389-6c1715707427",
      "fields": {
        "name": "HTML include macro for Confluence cloud",
        "available": "[\"cloud\"]"
      },
      "ownedBy": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6"
    },
    {
      "recordId": 5,
      "createdBy": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6",
      "created": 1587043431850,
      "id": "766096bd-1b4f-4288-a792-41a872230417",
      "fields": {
        "name": "Smart ConfiTemplates",
        "available": "[\"cloud\",\"dc\",\"server\"]"
      },
      "ownedBy": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6"
    },
    {
      "recordId": 6,
      "createdBy": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6",
      "created": 1587043451356,
      "id": "12eb1ce8-0a77-4f1c-877d-46cf7f4d3b18",
      "fields": {
        "name": "SpaceAuditor - Statistics & Analytics",
        "available": "[\"server\"]"
      },
      "ownedBy": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6"
    }
  ]
}


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! (smile)

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.




  • No labels