This is the documentation for ConfiForms Server/Data Center app
However, this might also work for ConfiForms cloud and in most cases it does. But please see this page to understand the differences between server and cloud versions of the ConfiForms app.
In this short tutorial we will show you how to use a Webservice Object Referencing Field type in ConfiForms
We will configure it to show the data from Jira issue And alternatively from a Confluence page. So there will be 2 fields of this type in a form
We are configuring a form with 2 fields, one to point at our confluence and another to point at our Jira instance
jiraRef | pageMetadata |
---|---|
We also have a Hide Field rule to hide "pageMetadata" as we always want it to show the current page's metadata
The APIs we use return something like this
And we want to show the "Page title" and the issue type description for this particular issue, in a table...
Build like this
And to access "page title" we use the following expression (in the "field name" parameter of the ConfiForms Field macro) to navigate to a desired property:
pageMetadata.title
And to navigate to Jira issue type description we use
jiraRef.fields.issuetype.description
<h1>Form</h1> <ac:structured-macro ac:macro-id="8513c626-244c-4d2f-a1c6-20fbfce5b366" ac:name="confiform" ac:schema-version="1"> <ac:parameter ac:name="formName">myform</ac:parameter> <ac:rich-text-body> <ac:structured-macro ac:macro-id="d66e6cc7-51ec-4b0c-8c68-c74a0a2ae0cc" ac:name="confiform-entry-register" ac:schema-version="1"> <ac:parameter ac:name="restrictions">confluence-administrators</ac:parameter> <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter> <ac:rich-text-body> <p> <br/> </p> </ac:rich-text-body> </ac:structured-macro> <p> <ac:structured-macro ac:macro-id="f2a06e3e-cb74-441b-8c8d-9464178a6887" ac:name="confiform-field-definition" ac:schema-version="1"> <ac:parameter ac:name="mapping">|key|undefined</ac:parameter> <ac:parameter ac:name="fieldName">jiraRef</ac:parameter> <ac:parameter ac:name="fieldLabel">Jira issue reference</ac:parameter> <ac:parameter ac:name="values">/rest/api/latest/issue/[entry.jiraRef]</ac:parameter> <ac:parameter ac:name="extras">4bb4c41a51f289a07507d50a1b841a4d</ac:parameter> <ac:parameter ac:name="type">objectRef</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="d5acc738-3bd8-45d2-9c7c-5bcfef6c2f4f" ac:name="confiform-field-definition" ac:schema-version="1"> <ac:parameter ac:name="mapping">|id|undefined</ac:parameter> <ac:parameter ac:name="fieldName">pageMetadata</ac:parameter> <ac:parameter ac:name="fieldLabel">Page metadata</ac:parameter> <ac:parameter ac:name="values">/rest/api/content/[entry._page]</ac:parameter> <ac:parameter ac:name="extras">cfa616dd12ec3374aa15e100bd9e20be</ac:parameter> <ac:parameter ac:name="type">objectRef</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="731a46a8-1fa0-4e04-b778-55b0c9d63830" ac:name="confiform-field-definition-rules" ac:schema-version="1"> <ac:parameter ac:name="fieldName">pageMetadata</ac:parameter> <ac:parameter ac:name="action">Hide field</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <h1>Table</h1> <ac:structured-macro ac:macro-id="2d84b892-01fa-4aa2-b809-bab871188810" ac:name="confiform-table" ac:schema-version="1"> <ac:parameter ac:name="formName">myform</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="033f0763-b490-49d4-87b5-d1e92181d9e0" ac:name="confiform-field" ac:schema-version="1"> <ac:parameter ac:name="fieldName">pageMetadata</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="25d9ea60-cd04-487b-85e5-0746b9aa7b26" ac:name="confiform-field" ac:schema-version="1"> <ac:parameter ac:name="overrideLabel">Page title</ac:parameter> <ac:parameter ac:name="fieldName">pageMetadata.title</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="70e0d971-8419-4690-945d-02d502eb49fb" ac:name="confiform-field" ac:schema-version="1"> <ac:parameter ac:name="fieldName">jiraRef</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="1b4d0a80-e3d8-44ce-ae84-dc5284124648" ac:name="confiform-field" ac:schema-version="1"> <ac:parameter ac:name="overrideLabel">Jira issue type description</ac:parameter> <ac:parameter ac:name="fieldName">jiraRef.fields.issuetype.description</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro>