It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to use ConfiForms to create a JQL query & display the results?

Hi, 

I want to create a JQL query based on information entered by user via several ConfiForms Form Fields. The resulting JQL query will then be run to retrieve the JIRA fields that matches with the query.

I know how to create forms and display the result using ConfiForms but would like to learn how to do the above.

I am not able to find further examples on using ConfiForms field type 'JQL'. Appreciate any guidance from the gurus out there.

Thank you.

2 answers

Hi @4armstar ,

we also wanted to use the JQL field to find a issue and proceed with that issue.

We will use the AppLink service with the Jira REST search.

To use the result you have to load the result into a ConfiForms field and use the virtual function asJSON.

Please find a minimal working example below.

Please note that the JQL may not contain any spaces. You can use other virtual functions to escape any invalid characters.

<ac:structured-macro ac:macro-id="5e3d56b1-d746-459b-8e10-bd1dbfa8e0bd" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">search</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="a66a98af-909b-43c7-8293-fdfeede5d88e" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="embedded">true</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 class="auto-cursor-target">
<br/>
</p>
<p class="auto-cursor-target">
<ac:structured-macro ac:macro-id="85d80c31-d5b0-4ac3-8a2a-fd9a7c6d0c6f" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">jql</ac:parameter>
<ac:parameter ac:name="fieldLabel">JQL</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p class="auto-cursor-target">
<ac:structured-macro ac:macro-id="e03d4422-d9e0-4248-88c2-321bac13a90f" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">result</ac:parameter>
<ac:parameter ac:name="fieldLabel">Ergebnis</ac:parameter>
<ac:parameter ac:name="type">hidden</ac:parameter>
</ac:structured-macro>
</p>
<p class="auto-cursor-target">
<ac:structured-macro ac:macro-id="afd0945b-3596-46f4-8f64-620fd535bc39" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">total</ac:parameter>
<ac:parameter ac:name="fieldLabel">Anzahl der Ergebnisse</ac:parameter>
<ac:parameter ac:name="type">number</ac:parameter>
</ac:structured-macro>
</p>
<p class="auto-cursor-target">
<ac:structured-macro ac:macro-id="9f1fa02a-b2b8-4239-b190-7e77f3abe970" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">issue</ac:parameter>
<ac:parameter ac:name="fieldLabel">Jira Vorgangsschlüssel</ac:parameter>
<ac:parameter ac:name="type">jira</ac:parameter>
</ac:structured-macro>
</p>
<ac:structured-macro ac:macro-id="be383acb-80b4-44b0-b123-14d689828368" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="action">AppLink service</ac:parameter>
<ac:parameter ac:name="event">onCreated</ac:parameter>
<ac:parameter ac:name="extras2">/rest/api/latest/search?jql=[entry.jql]&amp;fields=key</ac:parameter>
<ac:parameter ac:name="resultName">myjqlsearchresult</ac:parameter>
<ac:parameter ac:name="who">GET</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="8b73e91f-cc38-4b96-846a-f5b54dd53604" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onCreated</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;result=${iftttResult_myjqlsearchresult}</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="9be13494-5fdc-4c7d-b05d-1f40ac6bee2a" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onCreated</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;total=[entry.result.asJSON.total]</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="7ad13578-bbe9-41f5-9f1b-ca5fd1e07183" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onCreated</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;issue=[entry.result.asJSON.issues[0].key]</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>

Wow! What a brilliant example!

Hi

JQL field type in ConfiForms just returns the number of issues matching the JQL criteria given and that is the only purpose it has

As per documentation: https://wiki.vertuna.com/display/CONFIFORMS/Accessing+field+values+and+properties the field has only 2 properties

myfeld.jql
myfeld.count

(assuming your JQL field is named "myfield")

How do you plan to use it I am a little bit unsure... as it works with issues in Jira, executing given JQL, and not with fields (when you say: "retrieve the JIRA fields that matches with the query.")

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

How is your team having fun and bonding, remotely, utilizing Confluence?

Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...

283 views 9 7
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you