Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to input data into a form and retrieve it results from the database using using the Run Self-Service Reports for Confluence and SQL for Confluence Confluence apps.

Instructions

  1. Make sure that database connection is successful using the SQL for Confluence app.
    1. Select the Log into your Jira instance as Jira administrator and navigate to Image Modified(Cog wheel) > Manage apps
    2. Select the From the left sidebar, select the SQL app > View and modify data source profiles and  and ensure that connection to the database is successful.
      Image Modified
  2. Insert an SQL macro  macro inside a Run with a user form and parameters macro macro:
  3. Insert SQL statement as per the requirement. In the example below, we consider retrieving data from the table persons:

  4. Edit the Run macro and add Field settings:
    Image Modified
  5. Select the Field type and add Field key. Here  Here the Field key is considered as per the SQL statement mentioned above (PersonID):
    Image Modified

  6. To enter more than one field, click on Add field:
    Image RemovedImage Added
  7. Save the  the macro settings and publish the page.
    Image Modified
  8. Provide input and click Run. As  As per the above SQL statement and input data entered in the form, data is retrieved from the database:
    Image Modified


Info

Any text in the macro body that begins with $ immediately followed by a key will be replaced by the values provided in the form.

...