avatarArshabhi Rai

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

4113

Abstract

e collector</i>, select<b> </b><i>Embed in Javascript.</i></p><figure id="c109"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*-KngeHRwSnXgK8RC8Sxe5Q.png"><figcaption></figcaption></figure><p id="486f">Copy and paste the code snippet in a text editor of your choice, or you can paste it directly on a Masterpage in your Flare project. I prefer using an external text editor such as Sublime or VS Code for any code-related updates. The code snippet will look something like this:</p><div id="5814"><pre><span class="hljs-comment">// Requires jQuery!</span> jQuery<span class="hljs-selector-class">.ajax</span>({</pre></div><div id="78c1"><pre>url: “https://yourcompany-jira.atlassian.net/s/d41d8cd98f00b204e9800998ecf8427e-T/o2joag/b/24/e73395c53c3b10fde2303f4bf74ffbf6/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs.js?locale=en-US&amp;collectorId=12345678<span class="hljs-string">", type: “get”, cache: true, dataType: “script” });</span></pre></div><div id="8f68"><pre><span class="hljs-variable language_">window</span>.<span class="hljs-property">ATL_JQ_PAGE_PROPS</span> = { “triggerFunction”: <span class="hljs-keyword">function</span>(<span class="hljs-params">showCollectorDialog</span>){ <span class="hljs-comment">//Requires that jQuery is available!</span> <span class="hljs-title function_">jQuery</span>(“#myCustomTrigger”).<span class="hljs-title function_">click</span>(<span class="hljs-keyword">function</span>(<span class="hljs-params">e</span>) { e.<span class="hljs-title function_">preventDefault</span>(); <span class="hljs-title function_">showCollectorDialog</span>(); }); }};</pre></div><p id="4e64">We will update the code snippet by adding some custom fields in the next step.</p><h1 id="06ab">Step 4: Customize the code snippet and create a custom trigger</h1><p id="6a58">We will add two new custom fields to the issue collector’s JavaScript code snippet and create a custom trigger using HTML and CSS.</p><p id="6a12">In the code snippet, we’ll add the following fieldValues:</p><div id="0811"><pre><span class="hljs-symbol">fieldValues:</span><span class="hljs-punctuation">{</span> <span class="hljs-symbol">recordWebInfo:</span><span class="hljs-number">1</span>’, <span class="hljs-comment">// field Name </span> <span class="hljs-symbol">recordWebInfoConsent:</span> [‘<span class="hljs-number">1</span>’] <span class="hljs-comment">// field Id</span> <span class="hljs-punctuation">}</span></pre></div><p id="cd9a">These field values will ensure that the optional environment checkbox is automatically selected to collect the source page URL.</p><p id="e9b1"><b>Updated JavaScript code snippet</b></p><div id="629a"><pre><span class="hljs-comment">// Requires jQuery!</span></pre></div><div id="055f"><pre>jQuery.ajax({ <span class="hljs-attribute">url</span>: “https://yourcompany-jira<span class="hljs-variable">.atlassian</span><span class="hljs-variable">.net</span>/s/d41d8cd98f00b204e9800998ecf8427e-T/o2joag/b/24/e73395c53c3b10fde2303f4bf74ffbf6/_/download/batch/com<span class="hljs-variable">.atlassian</span><span class="hljs-variable">.jira</span><span class="hljs-variable">.collector</span><span class="hljs-variable">.plugin</span><span class="hljs-variable">.jira-issue-collector-plugin</span>:issuecollector-embededjs/com<span class="hljs-variable">.atlassian</span><span class="hljs-variable">.jira</span><span class="hljs-variable">.collector</span><span class="hljs-variable">.plugin</span><span class="hljs-variable">.jira-issue-collector-plugin</span>:issuecollector-embededjs<span class="hljs-variable">.js</span>?locale=en-US&collectorId=12345678", type: “get”, cache: true, dataType: “script” });</pre></div><div id="c18a"><pre><span class="hljs-variable language_">window</span>.<span class="hljs-property">ATL_JQ_PAGE_PROPS</span> = { “triggerFunction”: <span class="hljs-keyword">function</span>(<span class="hljs-params">showCollectorDialog</span>) { <span class="hljs-commen

Options

t">//Requires that jQuery is available!</span> <span class="hljs-title function_">jQuery</span>(“#myCustomTrigger”).<span class="hljs-title function_">click</span>(<span class="hljs-keyword">function</span>(<span class="hljs-params">e</span>) { e.<span class="hljs-title function_">preventDefault</span>(); <span class="hljs-title function_">showCollectorDialog</span>(); }); }, <span class="hljs-attr">f1ieldValues</span>:{ <span class="hljs-attr">recordWebInfo</span>: ‘<span class="hljs-number">1</span>’, <span class="hljs-comment">// field Name </span> <span class="hljs-attr">recordWebInfoConsent</span>: [‘<span class="hljs-number">1</span>’] <span class="hljs-comment">// field Id</span> }};</pre></div><p id="5afc"><b>Custom trigger</b></p><p id="e751">HTML trigger button</p><div id="506a"><pre><span class="hljs-comment"><!-- Paste this on the master page.--></span></pre></div><div id="4924"><pre><span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">”#”</span> <span class="hljs-attr">id</span>=<span class="hljs-string">”myCustomTrigger”</span> <span class="hljs-attr">class</span>=<span class="hljs-string">”issue-collector”</span>></span>Provide feedback<span class="hljs-tag"></<span class="hljs-name">a</span>></span></pre></div><p id="f43c">Custom CSS</p><div id="bae2"><pre><span class="hljs-comment">/* This is the subtle issue collector style. Paste this on the stylesheet, but feel free to change it*/</span></pre></div><div id="c792"><pre><span class="hljs-selector-class">.issue-collector</span> { <span class="hljs-attribute">position</span>: fixed; <span class="hljs-attribute">bottom</span>: <span class="hljs-number">0px</span>; <span class="hljs-attribute">right</span>: <span class="hljs-number">0px</span>; <span class="hljs-attribute">border</span>: <span class="hljs-number">1px</span> solid <span class="hljs-number">#ccc</span>; <span class="hljs-attribute">border-bottom</span>: none; <span class="hljs-attribute">border-right</span>: none; <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#f5f5f5</span>; <span class="hljs-attribute">color</span>: <span class="hljs-number">#444</span> <span class="hljs-meta">!important</span>; <span class="hljs-attribute">font-size</span>: <span class="hljs-number">11px</span>; <span class="hljs-attribute">padding</span>: <span class="hljs-number">6px</span>; -webkit-<span class="hljs-attribute">box-shadow</span>: -<span class="hljs-number">1px</span> -<span class="hljs-number">1px</span> <span class="hljs-number">2px</span> <span class="hljs-built_in">rgba</span>(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0.5</span>); <span class="hljs-attribute">box-shadow</span>: -<span class="hljs-number">1px</span> -<span class="hljs-number">1px</span> <span class="hljs-number">2px</span> <span class="hljs-built_in">rgba</span>(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0.5</span>); <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">2px</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span>; }</pre></div><h1 id="fff0">Step 5: Embed the code snippet in your Flare project</h1><p id="30f5">You will need to embed the code snippet on the master pages and add the new CSS styles to the stylesheet. To embed the above codes, do the following:</p><ol><li>Open a master page in your Flare project and embed the JavaScript at the bottom of the page.</li><li>Copy the HTML code for the trigger button and paste it somewhere on the master page.</li><li>Copy the custom CSS style and paste it at the bottom of the stylesheet.</li></ol><p id="97b2">You can now start a build and test the feedback tool. You will notice that the optional environment checkbox is automatically selected, and the URL of the source page is collected in the JIRA issue.</p></article></body>

Adding a JIRA Issue Collector (feedback tool) to your MadCap Flare Documentation

In this article, I will show you how to add a custom JIRA Issue Collector to your MadCap Flare-based online documentation.

Why JIRA Issue Collector?

Adding a feedback mechanism to your web-based documentation is an excellent way to find areas for improvement. Every documentation site is different, so the requirements will likely vary. I would recommend that you do thorough research and try a few different tools before choosing. In our case, we wanted the following features in the toolset:

  • easy to manage and maintain
  • collects the URL and browser information, so we know precisely the area in the documentation the user is talking about
  • automatically generates a JIRA ticket

We have been using the issue collector for a couple of months and are happy with it.

Why do you need to customize the issue collector?

After creating an issue collector in JIRA, you can add the generated code snippet to your Flare project right away without any additional customization. It will work. There are, however, a few things you may want to customize.

An important feature that we wanted was the ability to automatically collect the source page’s URL. While the issue collector provides an optional checkbox for the users to share their system’s environment information (URL, browser, etc.), it is often left unchecked. Without that data, it is difficult to identify the source page and understand the problem.

To customize the JIRA issue collector, you will need to do a few things:

Step 1: JIRA Account and Permissions

First, you will need is a JIRA account with permission to manage the Project Settings, or at the least permission to configure the issue collector. If you don’t have permission to manage the project settings, ask your JIRA project administrator to add the “Environment” field to your JIRA project. You will need the Environment variable to collect the URL information of the source page.

Step 2: Create and Configure the Issue Collector

The option to create an issue collector will be under Project Settings > Issue Collectors. When you configure your issue collector, make sure to check and customize the following options:

Collector browser info

Make sure the checkbox is selected. This info is required to collect the URL of the source page.

Trigger

Select the Custom radio button. You need to create a custom trigger to add additional fields to the generated code snippet.

Issue Collector form

Similar to the Trigger, select Custom and ensure that the Environment field is available under Custom fields. You don’t need to select the checkbox. If you don’t see the Environment option, reach out to your JIRA project administrator.

Once you’ve completed your configuration, click Update.

Step 3: Copy the JavaScript code snippet

On the Issue Collector page, select your new issue collector. Then under Embedding this issue collector, select Embed in Javascript.

Copy and paste the code snippet in a text editor of your choice, or you can paste it directly on a Masterpage in your Flare project. I prefer using an external text editor such as Sublime or VS Code for any code-related updates. The code snippet will look something like this:

// Requires jQuery!
jQuery.ajax({
url: “https://yourcompany-jira.atlassian.net/s/d41d8cd98f00b204e9800998ecf8427e-T/o2joag/b/24/e73395c53c3b10fde2303f4bf74ffbf6/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs.js?locale=en-US&collectorId=12345678",
type: “get”,
cache: true,
dataType: “script”
});
window.ATL_JQ_PAGE_PROPS = {
“triggerFunction”: function(showCollectorDialog){
//Requires that jQuery is available!
jQuery(“#myCustomTrigger”).click(function(e) {
e.preventDefault();
showCollectorDialog();
});
}};

We will update the code snippet by adding some custom fields in the next step.

Step 4: Customize the code snippet and create a custom trigger

We will add two new custom fields to the issue collector’s JavaScript code snippet and create a custom trigger using HTML and CSS.

In the code snippet, we’ll add the following fieldValues:

fieldValues:{
recordWebInfo:1’, // field Name 
recordWebInfoConsent: [‘1’] // field Id
}

These field values will ensure that the optional environment checkbox is automatically selected to collect the source page URL.

Updated JavaScript code snippet

// Requires jQuery!
jQuery.ajax({
url: “https://yourcompany-jira.atlassian.net/s/d41d8cd98f00b204e9800998ecf8427e-T/o2joag/b/24/e73395c53c3b10fde2303f4bf74ffbf6/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs.js?locale=en-US&collectorId=12345678",
type: “get”,
cache: true,
dataType: “script”
});
window.ATL_JQ_PAGE_PROPS = {
“triggerFunction”: function(showCollectorDialog) {
//Requires that jQuery is available!
jQuery(“#myCustomTrigger”).click(function(e) {
e.preventDefault();
showCollectorDialog();
});
}, 
f1ieldValues:{
recordWebInfo: ‘1’, // field Name 
recordWebInfoConsent: [‘1’] // field Id
}};

Custom trigger

HTML trigger button

<!-- Paste this on the master page.-->
<a href=”#” id=”myCustomTrigger” class=”issue-collector”>Provide feedback</a>

Custom CSS

/* This is the subtle issue collector style. Paste this on the stylesheet, but feel free to change it*/
.issue-collector {
position: fixed;
bottom: 0px;
right: 0px;
border: 1px solid #ccc;
border-bottom: none;
border-right: none;
background-color: #f5f5f5;
color: #444 !important;
font-size: 11px;
padding: 6px;
-webkit-box-shadow: -1px -1px 2px rgba(0, 0, 0, 0.5);
box-shadow: -1px -1px 2px rgba(0, 0, 0, 0.5);
border-radius: 2px 0 0 0;
}

Step 5: Embed the code snippet in your Flare project

You will need to embed the code snippet on the master pages and add the new CSS styles to the stylesheet. To embed the above codes, do the following:

  1. Open a master page in your Flare project and embed the JavaScript at the bottom of the page.
  2. Copy the HTML code for the trigger button and paste it somewhere on the master page.
  3. Copy the custom CSS style and paste it at the bottom of the stylesheet.

You can now start a build and test the feedback tool. You will notice that the optional environment checkbox is automatically selected, and the URL of the source page is collected in the JIRA issue.

Madcap Flare
Madcap
Jira
Documentation
Technical Writing
Recommended from ReadMedium