Child pages
  • Using Webservice Object Referencing Field

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


Form configuration

Fields

jiraRefpageMetadata



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 

Jira

// 20210202191810
// https://vertuna.atlassian.net/rest/api/latest/issue/TEST-122

{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations,customfield_10941.properties,customfield_10942.properties",
"id": "16632",
"self": "https://vertuna.atlassian.net/rest/api/latest/issue/16632",
"key": "TEST-122",
"fields": {
"statuscategorychangedate": "2019-05-29T15:11:54.924+0300",
"issuetype": {
"self": "https://vertuna.atlassian.net/rest/api/2/issuetype/10004",
"id": "10004",
"description": "A problem which impairs or prevents the functions of the product.",
"iconUrl": "https://vertuna.atlassian.net/secure/viewavatar?size=medium&avatarId=10303&avatarType=issuetype",
"name": "Bug",
"subtask": false,
"avatarId": 10303
},
"timespent": null,
"project": {
"self": "https://vertuna.atlassian.net/rest/api/2/project/10200",
"id": "10200",
"key": "TEST",
"name": "Test Project",
"projectTypeKey": "software",
"simplified": false,
"avatarUrls": {
"48x48": "https://vertuna.atlassian.net/secure/projectavatar?pid=10200&avatarId=10011",
"24x24": "https://vertuna.atlassian.net/secure/projectavatar?size=small&s=small&pid=10200&avatarId=10011",
"16x16": "https://vertuna.atlassian.net/secure/projectavatar?size=xsmall&s=xsmall&pid=10200&avatarId=10011",
"32x32": "https://vertuna.atlassian.net/secure/projectavatar?size=medium&s=medium&pid=10200&avatarId=10011"
}
},
"fixVersions": [

],
"aggregatetimespent": null,
"resolution": null,
"customfield_10500": null,
"customfield_10940": null,
"customfield_10941": null,
"customfield_10942": null,
"customfield_10700": null,
"customfield_10943": null,
"customfield_10944": null,
"customfield_10945": null,
"customfield_10946": null,
"resolutiondate": null,
"workratio": -1,
"lastViewed": null,
"watches": {
"self": "https://vertuna.atlassian.net/rest/api/2/issue/TEST-122/watchers",
"watchCount": 1,
"isWatching": true
},
"issuerestriction": {
"issuerestrictions": {

},
"shouldDisplay": false
},
"created": "2019-05-29T15:11:54.585+0300",
"priority": {
"self": "https://vertuna.atlassian.net/rest/api/2/priority/3",
"iconUrl": "https://vertuna.atlassian.net/images/icons/priorities/medium.svg",
"name": "Medium",
"id": "3"
},
"customfield_10100": null,
"customfield_10300": {
"hasEpicLinkFieldDependency": false,
"showField": false,
"nonEditableReason": {
"reason": "PLUGIN_LICENSE_ERROR",
"message": "The Parent Link is only available to Jira Premium users."
}
},
"labels": [

],
"timeestimate": null,
"aggregatetimeoriginalestimate": null,
"versions": [

],
"customfield_10937": null,
"customfield_10938": [

],
"customfield_10939": null,
"issuelinks": [

],
"assignee": {
"self": "https://vertuna.atlassian.net/rest/api/2/user?accountId=557058%3A49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6",
"accountId": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6",
"emailAddress": "sasha@vertuna.com",
"avatarUrls": {
"48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6/724453b8-04c2-43f6-8315-fa266a2d435a/48",
"24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6/724453b8-04c2-43f6-8315-fa266a2d435a/24",
"16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6/724453b8-04c2-43f6-8315-fa266a2d435a/16",
"32x32": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6/724453b8-04c2-43f6-8315-fa266a2d435a/32"
},
"displayName": "Alex Medved",
"active": true,
"timeZone": "Europe/Tallinn",
"accountType": "atlassian"
},
"updated": "2019-05-29T15:11:54.585+0300",
"status": {
"self": "https://vertuna.atlassian.net/rest/api/2/status/10000",
"description": "",
"iconUrl": "https://vertuna.atlassian.net/",
"name": "To Do",
"id": "10000",
"statusCategory": {
"self": "https://vertuna.atlassian.net/rest/api/2/statuscategory/2",
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "To Do"
}
},
"components": [

],
"timeoriginalestimate": null,
"description": "again",
"customfield_10012": "0|i0020f:",
"timetracking": {

},
"customfield_10600": null,
"customfield_10007": null,
"security": null,
"customfield_10800": null,
"attachment": [

],
"customfield_10009": null,
"aggregatetimeestimate": null,
"customfield_10928": null,
"summary": "test me",
"creator": {
"self": "https://vertuna.atlassian.net/rest/api/2/user?accountId=557058%3A49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6",
"accountId": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6",
"emailAddress": "sasha@vertuna.com",
"avatarUrls": {
"48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6/724453b8-04c2-43f6-8315-fa266a2d435a/48",
"24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6/724453b8-04c2-43f6-8315-fa266a2d435a/24",
"16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6/724453b8-04c2-43f6-8315-fa266a2d435a/16",
"32x32": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6/724453b8-04c2-43f6-8315-fa266a2d435a/32"
},
"displayName": "Alex Medved",
"active": true,
"timeZone": "Europe/Tallinn",
"accountType": "atlassian"
},
"subtasks": [

],
"reporter": {
"self": "https://vertuna.atlassian.net/rest/api/2/user?accountId=557058%3A49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6",
"accountId": "557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6",
"emailAddress": "sasha@vertuna.com",
"avatarUrls": {
"48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6/724453b8-04c2-43f6-8315-fa266a2d435a/48",
"24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6/724453b8-04c2-43f6-8315-fa266a2d435a/24",
"16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6/724453b8-04c2-43f6-8315-fa266a2d435a/16",
"32x32": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:49c2eeaf-b72c-4e4d-86a7-97c1a77b50b6/724453b8-04c2-43f6-8315-fa266a2d435a/32"
},
"displayName": "Alex Medved",
"active": true,
"timeZone": "Europe/Tallinn",
"accountType": "atlassian"
},
"aggregateprogress": {
"progress": 0,
"total": 0
},
"customfield_10000": null,
"customfield_10001": null,
"customfield_10200": null,
"customfield_10003": null,
"customfield_10400": "{}",
"customfield_10004": null,
"environment": null,
"duedate": null,
"progress": {
"progress": 0,
"total": 0
},
"votes": {
"self": "https://vertuna.atlassian.net/rest/api/2/issue/TEST-122/votes",
"votes": 0,
"hasVoted": false
},
"comment": {
"comments": [

],
"self": "https://vertuna.atlassian.net/rest/api/2/issue/16632/comment",
"maxResults": 0,
"total": 0,
"startAt": 0
},
"worklog": {
"startAt": 0,
"maxResults": 20,
"total": 0,
"worklogs": [

]
}
}
}


Confluence

// 20210202191428
// https://wiki.vertuna.com/rest/api/content/70582440

{
"id": "70582440",
"type": "page",
"status": "current",
"title": "Using Webservice Object Referencing Field",
"space": {
"id": 655361,
"key": "CONFIFORMS",
"name": "ConfiForms",
"type": "global",
"_links": {
"webui": "/display/CONFIFORMS",
"self": "https://wiki.vertuna.com/rest/api/space/CONFIFORMS"
},
"_expandable": {
"metadata": "",
"icon": "",
"description": "",
"homepage": "/rest/api/content/557060"
}
},
"history": {
"latest": true,
"createdBy": {
"type": "known",
"username": "sash",
"userKey": "ff8080814b899f8f014b89a09f260002",
"profilePicture": {
"path": "/download/attachments/557058/user-avatar",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "Alex Medved",
"_links": {
"self": "https://wiki.vertuna.com/rest/api/user?key=ff8080814b899f8f014b89a09f260002"
},
"_expandable": {
"status": ""
}
},
"createdDate": "2021-02-02T19:13:43.073+02:00",
"_links": {
"self": "https://wiki.vertuna.com/rest/api/content/70582440/history"
},
"_expandable": {
"lastUpdated": "",
"previousVersion": "",
"contributors": "",
"nextVersion": ""
}
},
"version": {
"by": {
"type": "known",
"username": "sash",
"userKey": "ff8080814b899f8f014b89a09f260002",
"profilePicture": {
"path": "/download/attachments/557058/user-avatar",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "Alex Medved",
"_links": {
"self": "https://wiki.vertuna.com/rest/api/user?key=ff8080814b899f8f014b89a09f260002"
},
"_expandable": {
"status": ""
}
},
"when": "2021-02-02T19:13:43.073+02:00",
"message": "",
"number": 1,
"minorEdit": false,
"hidden": false,
"_links": {
"self": "https://wiki.vertuna.com/rest/experimental/content/70582440/version/1"
},
"_expandable": {
"content": "/rest/api/content/70582440"
}
},
"extensions": {
"position": "none"
},
"_links": {
"webui": "/display/CONFIFORMS/Using+Webservice+Object+Referencing+Field",
"edit": "/pages/resumedraft.action?draftId=70582440",
"tinyui": "/x/qAA1B",
"collection": "/rest/api/content",
"base": "https://wiki.vertuna.com",
"context": "",
"self": "https://wiki.vertuna.com/rest/api/content/70582440"
},
"_expandable": {
"container": "/rest/api/space/CONFIFORMS",
"metadata": "",
"operations": "",
"children": "/rest/api/content/70582440/child",
"restrictions": "/rest/api/content/70582440/restriction/byOperation",
"ancestors": "",
"body": "",
"descendants": "/rest/api/content/70582440/descendant"
}
}


And we want to show the "Page title" and the issue type description for this particular issue, in a table...

Online Demo

Jira issue reference

Jira issue type description

JTEST-12 The sub-task of the issue

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


Storage format

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