Child pages
  • Using Confluence templates with ConfiForms and avoid configuration duplication

Versions Compared

Key

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

...

And now is the most intersting part

Image Added

Image AddedImage Removed

As you can see, we have added 2 IFTTT macros, one to create a page, another one to send email (If we need to save the link to a newly created page in ConfiForms - it is also possible, but will require another IFTTT to be added, Creating links in original ConfiForms entry to just created page). In this tutorial, for simplicity reason, we do not store the link within the form.

...

The page created:

And the email sent with the same content

Image Added

As you can see the tenmplate was added and parsed and styling was also sept, but misses the CSS used by Confluence. 

If you need to mimic the page in Confluence you will need to add custome CSS styles into IFTTT body macro

 

 

Expand
titleComplete solution in storage format can be found here:
Code Block
<ac:structured-macro ac:macro-id="87547728-9eca-49b5-8b3a-842168920b66" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">f</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="a26ca8e6-514d-476a-b1cd-b03914bb8c47" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">subject</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Subject</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
      </ac:structured-macro>
      <ac:structured-macro ac:macro-id="59f8f010-45de-47db-92ec-9ac567ecd074" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">msgdetails</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Message details</ac:parameter>
        <ac:parameter ac:name="type">wysiwyg</ac:parameter>
      </ac:structured-macro>
      <ac:structured-macro ac:macro-id="40cc9a55-bfc5-4abc-8e6c-a8b452c87264" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">choice</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Choice</ac:parameter>
        <ac:parameter ac:name="values">false[1=Choice 1|2=Choice 2|3=Choice 3|]</ac:parameter>
        <ac:parameter ac:name="type">select</ac:parameter>
      </ac:structured-macro>
    </p>
    <ac:structured-macro ac:macro-id="4697ec46-2f85-459e-8350-0462b846b840" ac:name="confiform-ifttt" ac:schema-version="1">
      <ac:parameter ac:name="action">Create Page</ac:parameter>
      <ac:parameter ac:name="event">onCreated</ac:parameter>
      <ac:parameter ac:name="title">[entry.subject]</ac:parameter>
      <ac:rich-text-body>
        <p>Hello<strong> [entry.createdBy.fullName]</strong>
        </p>
        <p>
          <span>[template.mytemplate]</span>
        </p>
        <p>
          <span>
            <ac:structured-macro ac:macro-id="4ed7249e-7ba0-4b5d-9e66-9ad7e4c624f1" ac:name="confiform-entry-edit" ac:schema-version="1">
              <ac:parameter ac:name="inline">true</ac:parameter>
            </ac:structured-macro>
            <br/>
          </span>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="cc2cd11f-31f3-4197-9471-53e6b7e25373" ac:name="confiform-ifttt" ac:schema-version="1">
      <ac:parameter ac:name="action">Send Email</ac:parameter>
      <ac:parameter ac:name="event">onCreated</ac:parameter>
      <ac:parameter ac:name="who">sasha@vertuna.com</ac:parameter>
      <ac:rich-text-body>
        <p>This page was created from a <strong style="line-height: 1.42857;">Confluence template</strong> by <span style="line-height: 1.42857;"> [entry.createdBy.fullName] on <span> [entry.created.formatDate(dd.MM.yyyy HH:mm)]</span>
          </span>
        </p>
        <p>
          <span>[template.mytemplate]</span>
        </p>
        <p>
          <span>
            <br/>
          </span>
        </p>
        <p>
          <span>The page can be found here:</span>
        </p>
        <ac:structured-macro ac:macro-id="36e9dcc9-8ea0-48e6-942f-d267a90550db" ac:name="html" ac:schema-version="1">
          <ac:plain-text-body><![CDATA[<a href="http://localhost:1990/confluence/pages/viewpage.action?pageId=${iftttResult_0.id}">${iftttResult_0.displayTitle}</a>]]></ac:plain-text-body>
        </ac:structured-macro>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>
<p>
  <ac:structured-macro ac:macro-id="cd00333a-69b4-4156-9d85-3f6f6b5f4e55" ac:name="confiform-entry-register" ac:schema-version="1">
    <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
    <ac:rich-text-body>
      <p>[template.mytemplate]</p>
    </ac:rich-text-body>
  </ac:structured-macro>
</p>