Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

ConfiForms add-on has a macro called ConfiForms IFTTT to enable integrations with external systems or with Confluence itself.

Below, you can find a list of integrations scenarios the macro can support and it's configuration details

Actions list

There are 24 different actions supported by IFTTT out-of-the-box (some actions are very generic, so the integration scenarios number is a lot bigger)

  • Add Page Label
  • Add Page Watcher
  • AppLink service
  • Copy ConfiForms Data
  • Copy ConfiForms Data to DB
  • Create Attachment
  • Create BlogPost
  • Create (Update) ConfiForms Entry
  • Create JIRA Issue
  • Create Page
  • Create Task
  • Delete ConfiForms Entry
  • Delete Page
  • Force Page Re-index
  • Make request
  • Move Attachment
  • Move Page
  • Remove Page Label
  • Remove Page Watcher
  • Rename Page
  • Render (execute) macro
  • Run JavaScript
  • Send Email
  • Send Notification
  • Update JIRA Issue

 

Each IFTTT action has own parameters, but the following parameters are supported by all actions

 

Warning

When specified (in the docs below, for an action) - a macro body is used as a template, otherwise leave it empty

 

 

Parameter nameDescription
Event

Type of event in ConfiForms this IFTTT action should be fired on

  • On Created
  • On Modified
  • On Deleted

 

Action to performOne of the actions to perform. See the list above
Do not report errorA checkbox field to disable error reporting and continue with the workflow even if current macro has resulted in an error
Custom name for the action result

This is used in advanced techniques, when you want to use the result of the IFTTT in next IFTTT or want to save the result of some IFTTT or some part of the result back into a ConfiForms record. See below the result types and the contents stored in the result for each IFTTT action.

 

A result (depending on the action type) is stored in the context in the variable prefixed by "iftttResult_"

And is accessible using the Velocity notation via

Code Block
${iftttResult_RESULTNAME}

Where "RESULTNAME" is the value given in this macro parameter.

Some results hold rich objects. See "Result type" section for exact IFTTT action below

 

Add Page Label

Adds label to a page, you can apply a label (or labels) to page sub-pages as well

Result type:NO RESULT

Add Page Watcher

Adds a user or group of users as a page watcher
Result type:

Page object (page where the watcher's were added)

Depending on the IFTTT result name you can access all of the properties available from Page object.

For example (when result name is MYRESULT)

Code Block
${iftttResult_MYRESULT.id}
${iftttResult_MYRESULT.spaceKey}
${iftttResult_MYRESULT.displayTitle}

Any other property, which Page object provide (any "get" method)

Applink Service

Sends a request to configured Application link service

A user specifies which HTTP method to use, which URL service to execute (url must be given as "relative" url, this means it is "concatenated" with the base url in your applink service)

More about Application links in Confluence could be found here: https://confluence.atlassian.com/display/APPLINKS/Application+Links+Documentation

Result type:

Response returned from a request to a service is returned and stored as result

If response is a JSON then you can apply Virtual functions to work on a JSON object

Please note that virtual functions could be applied only on ConfiForms fields, not the IFTTT result directly. This means you will need to save the response to some ConfiForms field temporarily in order to apply the functions and convert the response to JSON.

Copy ConfiForms Data

 

Copies data from one ConfiForms form to another, can have custom mapping for fields and have a filter applied before copying the data

Also, it can "flatten" the multi-select values to copy the data to a new form in an "expanded" view

 

Please note that if you leave the filter empty then ALL the records from a source form will be copied to a destination form.

To copy just one, current record, you will need to apply the following filter

Code Block
id:[entry.id]
Warning

It is important to note that this action never fires any other "Create ConfiForms Entry", "Delete ConfiForms Entry" or "Copy ConfiForms Data" for the entry created

Result type:Last created (copied) record as object. This means that you can access any property available in ConfiForms record. Please note that the values accessed using the Velocity notation (${}) return "raw" (internal) values. More on this Accessing field values and properties

Copy ConfiForms Data to DB

 

Executes a SQL statement you specify on your database (on the database connection you have configured)

You must specify a valid SQL statement - either INSERT or UPDATE

Similar to "Copy ConfiForms Data" action you can filter records on original form before copying, as well as "flatten" records in order to have multi-value fields as separate rows (if necessary)

 

ConfiForms uses JDBC driver to connect to your database. See more on Some guidelines on using database fields in ConfiForms and Working with database fields in ConfiForms

Result type:NO RESULT

Create Attachment

 

Creates a file, based on the content you specify in macro body and uploads it as attachment.

See more Creating a file with calendar invitation (ics) and sending it via email with ConfiForms

You need to specify field name to use to store the reference to a created attachment - ConfiForms field of type "File" is the preferred field type to store this

 

 

Macro body:

macro-body-default-text

Result type:File contents as text into the result

Create BlogPost

 
 

Creates blog post based on the contents in macro body and the title given.

Blog post will be created in a Confluence space specified.

You can apply labels to a created blog post

Macro body:

macro-body-default-text

Result type:

Created Blog Post - complete object, as https://docs.atlassian.com/confluence/5.8.9/com/atlassian/confluence/pages/BlogPost.html

Example:

Code Block
${iftttResult_MYRESULT.id}
${iftttResult_MYRESULT.displayTitle}
other properties from BlogPost object

(if result was named "MYRESULT")

 

Create (Update) ConfiForms Entry

 

 

Creates (or updates) ConfiForms Entry in the specified form

Warning

It is important to note that this action never fires any other "Create ConfiForms Entry", "Delete ConfiForms Entry" or "Copy ConfiForms Data" for the entry created

Additionally, you can stop the propagation of the "create/update" events completely.

 

To update the current ConfiForms record leave the "Reference to form and it's location" empty and in parameters to set specify:

Code Block
entryId=[entry.id]

To target the current record

Result type:

Created entry object, same as in Copy ConfiForms Data

 

Code Block
${iftttResult_MYRESULT.somefield}

Where "somefield" is the name of the field in ConfiForms form

  

Create JIRA Issue

 

Creates JIRA issue based on the JSON mapping given

See Creating JIRA issue with ConfiForms

You can add users as watchers to created JIRA issue. Must be a valid user (list of users) given

 

When you want to add an attachment to JIRA issue from ConfiForms file field - you will need to place the "ConfiForms Field" macro inside the ConfiForms IFTTT macro body. This way, you will tell ConfiForms, in addition to issue creation, to upload the file to JIRA. You can upload multiple files, just by placing additional ConfiForms Field macros referencing other file fields into the macro body

Macro body:

JSON mapping wrapped in "No Format" macro to have a raw text

JSON mapping should be of structure specified in JIRA REST API - https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-create-issue

Result type:

Created issue KEY as text

Code Block
${iftttResult_MYRESULT}

(if result was named "MYRESULT")

  

Create Page

 

Creates Confluence page based on the template given (in macro body)

See Creating links in original ConfiForms entry to just created page

Using ConfiForms as a page template

 

Warning

In Confluence the page title should be unique within a Confluence space.

ConfiForms will create a new version of the page if the page with given title already exists in the Confluence space specified

Warning

Important to note is that if you put ConfiForms Field macros inside the IFTTT macro body and this macros will be WITHOUT a "view" macro around them, then a ListView macro with a filter set to current record is created as a wrapper for ALL the content in the IFTTT macro body.

If you want to avoid "auto-wrapping" then you need to make sure that all ConfiForms Field macros you put are within the "view" macro (TableView, ListView, CardView, etc)

In contrast, when you use [entry.fieldname] notations then there is no need to wrap anything in views macros. But in this case the data is static data copied (not referenced) there from ConfiForms

Info

All references (like [entry.filed_name]) inside the IFTTT macro body to ConfiForms fields are evaluated against the current record.

If you have an IFTTT action to create a page with ConfiForms Form and it should have filters or field rules which in the created page should look like [entry.fieldname] you will need to wrap these into a virtual function

Code Block
asEntryRef(REF_TO_ENTRY)

ConfiTemplates Smart Template
sourcePage
excerptvertuna-smart-template#9d900459-6358-4a80-8926-405c32106fd0
content2359385

 

Macro body:
macro-body-default-text
Result type:

Page object (page created)

Depending on the IFTTT result name you can access all of the properties available from Page object.

For example (when result name is MYRESULT)

Code Block
${iftttResult_MYRESULT.id}
${iftttResult_MYRESULT.spaceKey}
${iftttResult_MYRESULT.displayTitle}
...

Any other property, which Page object provides (any "get" method)

  

Create Task

 

Creates a personal task for a given user.

Please note that personal tasks has been deprecated in Confluence since version 5.7 (?)

 

Participants here are the user will task will be created for

Macro body:
macro-body-default-text
Result type:

Task object (created)

https://docs.atlassian.com/mywork-api/1.11.1.8/com/atlassian/mywork/model/Task.html

For example (when result name is MYRESULT)

Code Block
${iftttResult_MYRESULT.title}
...

Any other property, which Task object provides (any "get" method)

  

Delete ConfiForms Entry

 

Deletes the ConfiForms entries by a given filter

 

To delete the current record use the filter like this:

Code Block
id:[entry.id]
Result type:NO RESULT
  

Delete Page

 

Deletes the page in Confluence

A user must have enough permissions to delete the page

Result type:

Page object to be deleted

Depending on the IFTTT result name you can access all of the properties available from Page object.

For example (when result name is MYRESULT)

Code Block
${iftttResult_MYRESULT.id}
${iftttResult_MYRESULT.spaceKey}
${iftttResult_MYRESULT.displayTitle}
...

Any other property, which Page object provides (any "get" method)

  

Force Page Re-index

 

Forces page re-index

Sometimes you want a particular page to be re-indexed when a ConfiForms entry get's created/updated or deleted. This action type helps you to achieve that.

Result type:

Resolved Page object to re-index

Depending on the IFTTT result name you can access all of the properties available from Page object.

For example (when result name is MYRESULT)

Code Block
${iftttResult_MYRESULT.id}
${iftttResult_MYRESULT.spaceKey}
${iftttResult_MYRESULT.displayTitle}
...

Any other property, which Page object provides (any "get" method)

  

Make request

 

Makes GET or POST request to a configured resource

GET request is made when an IFTTT macro body is empty

POST request is made when an IFTTT macro contains a body, then this contents is sent to a configured resource as a stream, via POST request

Warning

This IFTTT action works well only with GET requests. We suggest to use "Application links" instead. The main reason - it's broader functionality and ability to hide the authentication details from an end user

Macro body:
macro-body-default-text
Result type:

Response text returned from a request made.

Code Block
${iftttResult_MYRESULT}

(when result name is set as "MYRESULT")

  

Move Attachment

 

Moves attachment from one page to another

You should specify the attachment ID to be moved and the page destination it should be moved to. A user must have enough permissions to attach the file to a destination page and enough permissions to read the configured attachment.

Can move multiple attachments in one go, See Virtual functions for "asAttachment" function to see how

Result type:NO RESULT
  

Move Page

 

Moves page from one location to another

A user performing an operation should have enough permissions (to move the page from source location to destination location)

Result type:

Moved page as object. Any property a Page object has

For example (when result name is MYRESULT)

Code Block
${iftttResult_MYRESULT.id}
${iftttResult_MYRESULT.spaceKey}
${iftttResult_MYRESULT.displayTitle}
...

Any other property, which Page object provides (any "get" method)

  

Remove Page Label

 
Removes page label(s). Silently ignores if a page does not have a requested label to be removed
Result type:

Page object, Any property a Page object  via

Code Block
${iftttResult_MYRESULT.<PAGE_OBJECT_PROPERTY>}


  

Remove Page Watcher

 

Removes page watcher or watchers from the page

Silently ignores if a page does not have a requested watcher to be removed.

Result type:

Page object, Any property a Page object via

Code Block
${iftttResult_MYRESULT.<PAGE_OBJECT_PROPERTY>}
  

Rename Page

 

Renames a page

A user performing an operation should have enough permissions to modify the page

Result type:

Page object, Any property a Page object via

Code Block
${iftttResult_MYRESULT.<PAGE_OBJECT_PROPERTY>}
  

Render (execute) macro

 
 

Renders a contents of it's body and adds the result of a render into a result chain

Result type:

What render macro renders, as string

Code Block
${iftttResult_MYRESULT}
  

Run JavaScript

 
 

Executes a JavaScript snippet given in the IFTTT macro body

Code snippet is executed in the "init" block

Code Block
<script type="text/javascript">
  AJS.toInit(function() {
      ...
      YOUR CODE WILL BE HERE
      ...
  });
</script>

And will be executed on a page load.

Macro body:
macro-body-default-text
Result type:

An internal object holding a JavaScript snippet

You can access script value (as text)

Code Block
${iftttResult_MYRESULT.script}or${iftttResult_MYRESULT}

(when IFTTT result is called "MYRESULT")

  

Send Email

 

Send email to a recipient or a group of recipients

Each email is sent individually

To add ConfiForms file field to an email as attachment - place ConfiForms Field macro into the IFTTT macro body

 

Email server configured in your Confluence server is used for sending the emails

Emails sent by ConfiForms are NOT queued and sent immediately (to avoid "bulk" message flags, and sent "individual and personal" direct messages)

Macro body:

Is the template to be used to construct an email message body

See more on Sending an email with attachments from ConfiForms

macro-body-default-text

Result type:

NO RESULT (for versions of ConfiForms prior to 1.39.2)

Status
colourGreen
titlefrom version 1.39.2

The following properties are supported from version 1.39.2

Code Block
subject
body
recipientsCount

This means, you can access it with

Code Block
${iftttResult_MYRESULT.subject}
${iftttResult_MYRESULT.body}
${iftttResult_MYRESULT.recipientsCount}
  

Send Notification

 

Sends internal notification to a user (or users) in Confluence

Notification will appear in the top-right corner. The message body is configured using the ConfiForms macro body

Macro body:
macro-body-default-text
Result type:NO RESULT
  

Update JIRA Issue

 

Updates JIRA issue

JIRA issue key must be set as macro parameter, could be looked up dynamically from ConfiForms field

It is a wrapper action to ease the setup of updates to JIRA issue from ConfiForms. Same could be achieved with the help of "Applink service" action

IFTTT macro body should hold a JSON structure to update the JIRA issue (use "No Format" macro to construct JSON structure as-is)

Example:

Another example:

See more on JSON structure the "update JIRA issue" API expects

https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/updating-an-issue-via-the-jira-rest-apis

Macro body:
macro-body-default-text
Result type:

Issue key as text, accessible directly via result name (for example, if result name is "MYRESULT")

Code Block
${iftttResult_MYRESULT}

 

More documentation and tutorials on ConfiForms IFTTT macro

Info

Advanced integrations with IFTTT macros with ConfiForms

Redirect to a created with IFTTT page

Conditional statements in IFTTT macro body