Child pages
  • Using Field Definition Rule to request data from JIRA and set it to ConfiForms fields

Versions Compared

Key

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

...

Excerpt Include
Creating a simple form in Confluence with ConfiForms
Creating a simple form in Confluence with ConfiForms
nopaneltrue

Let's start with a simple form

...

Code Block
<ac:structured-macro ac:macro-id="0ac060cf-c01e-4b08-bccf-6ecba9bc13a2" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">f</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="ffda1fef-a7fc-4eda-8659-ef0107f79012" ac:name="confiform-entry-register" ac:schema-version="1">
      <ac:parameter ac:name="embedded">true</ac:parameter>
      <ac:rich-text-body>
        <p> </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p>
      <ac:structured-macro ac:macro-id="e09ebd7b-dde0-4a2b-8b81-aa6d41f703ac" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="css">max-width:100px;width:100px;</ac:parameter>
        <ac:parameter ac:name="fieldName">keyCF</ac:parameter>
        <ac:parameter ac:name="fieldLabel">JIRA ticket #</ac:parameter>
        <ac:parameter ac:name="fieldDescription">projectkey-000</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="4371f87c-8e6d-4b7f-9d6b-f1f9b71f66f6" ac:name="confiform-field-definition-rules" ac:schema-version="1">
        <ac:parameter ac:name="condition">!keyCF:[empty]</ac:parameter>
        <ac:parameter ac:name="fieldName">reporterCF=fields.reporter.name&amp;summaryCF=fields.summary</ac:parameter>
        <ac:parameter ac:name="values">[entry.jkkeyCF]</ac:parameter>
        <ac:parameter ac:name="action">Lookup and set JIRA issue data</ac:parameter>
        <ac:parameter ac:name="actionFieldName">keyCF</ac:parameter>
        <ac:parameter ac:name="values2">JIRA</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="36f3ebd8-aa8e-458a-bf0d-78a8cf672b6b" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">reporterCF</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Reporter field from JIRA</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="20302f9b-ba51-4aeb-bb65-e5adffdb09bf" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">summaryCF</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Summary</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>

...

Code Block
     <ac:structured-macro ac:macro-id="4371f87c-8e6d-4b7f-9d6b-f1f9b71f66f6" ac:name="confiform-field-definition-rules" ac:schema-version="1">
        <ac:parameter ac:name="condition">!keyCF:[empty]</ac:parameter>
        <ac:parameter ac:name="fieldName">reporterCF=fields.reporter.name&amp;summaryCF=fields.summary</ac:parameter>
        <ac:parameter ac:name="values">[entry.jkkeyCF]</ac:parameter>
        <ac:parameter ac:name="action">Lookup and set JIRA issue data</ac:parameter>
        <ac:parameter ac:name="actionFieldName">keyCF</ac:parameter>
        <ac:parameter ac:name="values2">JIRA</ac:parameter>
      </ac:structured-macro>

...