Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Creating Jira issues with ConfiForms app for Confluence cloud uses the same concepts and approach as the server/data center version |
Expand | ||||
---|---|---|---|---|
| ||||
|
Especially to the demos around creating Jira issues via web service connections. As this is exactly the method used in ConfiForms app for Confluence cloud
Here is a step by step tutorial on how to setup a form in Confluence cloud to create issues in JIRA
The form, we are about to create
Image Modified
2 fields, one to ask for JIRA issue summary and another to ask about issue description
The 3rd field is of type JIRA and is hidden with the rule (initially, for new records)
Configuration looks like this
Image Modified
Info |
---|
Very useful page to see how various Jira field types shall be mapped https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/ |
We have 2 IFTTTs to create the issue and to store the result of this operation (Jira issue key) back to ConfiForms record (the macro you see as "Unknown macro" is actually "ConfiForms IFTTT rules" macro, but as it uses the $ in the parameter expression the editor goes a bit crazy and reports this as "unknown macro". You can safely ignore this)
In order for our 1st IFTTT to create the JIRA issue to work you need to go to ConfiForms app settings and configure web-service connection to your JIRA
ConfiForms app settings could be accessed like this
Image Modified
Image Modified
Image Modified
You will have something like this (but using your server details and username)
Image Modified
Warning | ||
---|---|---|
Please make sure you follow the advise and generate API token to access Jira
as basic auth is deprecated by Atlassian and will not work |
And the IFTTT is configured as follows
Image Modified
Image Modified
Second IFTTT is configured as follows
Image Modified
It uses the result of the previous IFTTT and sets it back to ConfiForms record
Code Block |
---|
entryId=[entry.id]&jiraKey=${iftttResult_JI.key} |
We using the result of the "JI" IFTTT action and take the "key" property of it - the object stored in the result is the JSON response object returned by JIRA server
Complete storage format is as follows (we also have a ConfiForms TableView to show the data stored with this ConfiForms Form)
Code Block |
---|
<p class="auto-cursor-target"><br/></p>
<p><br/></p>
<ac:structured-macro ac:name="confiform" ac:schema-version="1" ac:macro-id="07191fcd-1954-4e6d-8a0e-63536f9d9de7">
<ac:parameter ac:name="formName">myform</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1"
ac:macro-id="60f14199-9c9e-44f9-8f59-f0e540ebca35">
<ac:parameter ac:name="fieldName">summary</ac:parameter>
<ac:parameter ac:name="fieldLabel">Summary</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1"
ac:macro-id="ffbb4283-f010-4ffe-ad0c-f0e8f69e15f2">
<ac:parameter ac:name="fieldName">description</ac:parameter>
<ac:parameter ac:name="fieldLabel">Description</ac:parameter>
<ac:parameter ac:name="type">textarea</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1"
ac:macro-id="7bc8c39f-1075-44ae-bbb6-d0af118d5ddc">
<ac:parameter ac:name="fieldName">jiraKey</ac:parameter>
<ac:parameter ac:name="fieldLabel">jiraKey</ac:parameter>
<ac:parameter ac:name="type">jira</ac:parameter>
<ac:parameter ac:name="extras">e6b2ccca-1bec-4b00-9a59-2850aa00cd6a</ac:parameter>
</ac:structured-macro> <ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1"
ac:macro-id="d866a3e6-5ade-4378-8361-8899eaaf17f1">
<ac:parameter ac:name="condition">id:[empty]</ac:parameter>
<ac:parameter ac:name="fieldName">jiraKey</ac:parameter>
<ac:parameter ac:name="action">Hide field</ac:parameter>
</ac:structured-macro> - rule to hide the jiraKey field
</p>
<p><br/></p>
<ac:structured-macro ac:name="confiform-entry-register" ac:schema-version="1"
ac:macro-id="932c3f67-8923-4a16-8878-78597d012ce2">
<ac:parameter ac:name="overrideSaveButtonLabel">Create Jira issue</ac:parameter>
<ac:parameter ac:name="formName">myform</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"><br/></p>
<p class="auto-cursor-target"><br/></p>
<ac:structured-macro ac:name="confiform-ifttt" ac:schema-version="1"
ac:macro-id="94deac46-2b58-4cc2-b854-778807ee07e1">
<ac:parameter ac:name="action">Create JIRA Issue</ac:parameter>
<ac:parameter ac:name="extras">e6b2ccca-1bec-4b00-9a59-2850aa00cd6a</ac:parameter>
<ac:parameter ac:name="event">onCreated</ac:parameter>
<ac:parameter ac:name="resultName">JI</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target"><br/></p>
<ac:structured-macro ac:name="noformat" ac:schema-version="1"
ac:macro-id="ad9d9576-2025-42a5-a7cc-f2dd05f0fdba">
<ac:plain-text-body><![CDATA[{
"fields": {
"project":
{
"key": "JTEST"
},
"summary": "[entry.summary.escapeJSON]",
"description": "[entry.description.escapeJSON]",
"issuetype": {
"name": "Bug"
}
}
}]]>
</ac:plain-text-body>
</ac:structured-macro>
<p class="auto-cursor-target"><br/></p></ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:name="confiform-ifttt" ac:schema-version="1"
ac:macro-id="e6b8116b-5d52-4458-95db-83fe22495413">
<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]&jiraKey= |
...
[iftttResult_JI.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> <p class="auto-cursor-target">Show all</p> <ac:structured-macro ac:name="confiform-table" ac:schema-version="1" ac:macro-id="4e37c280-e3b1-4466-ae8f-763e551dfbdd"> <ac:parameter ac:name="formName">myform</ac:parameter> <ac:rich-text-body> <p><br/></p></ac:rich-text-body> </ac:structured-macro> |
Warning |
---|
If you are looking Confluence cloud new editor then please use "code" macro instead of "noformat" |
Image Added
Also, with "new editor" nesting of bodied macros is not supported and you need to place your IFTTT macros outside the ConfiForms Form (Definition) macro. (The editor simply does not allow you to put these macros inside)
In this case please make sure you set the "Form name" parameter to match your form name
Image Added