Snippets for Fast Responses and Templating - FogBugz Knowledge Exchange most recent 30 from http://fogbugz.stackexchange.com2013-05-22T19:11:09Zhttp://fogbugz.stackexchange.com/feeds/question/8945http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://fogbugz.stackexchange.com/questions/8945/snippets-for-fast-responses-and-templatingSnippets for Fast Responses and TemplatingRich Armstrong2011-08-05T14:17:34Z2012-09-21T15:28:47Z
<p>Snippets are a way to quickly insert blocks of text you use frequently.</p>
http://fogbugz.stackexchange.com/questions/8945/snippets-for-fast-responses-and-templating/9471#9471Answer by Rich Armstrong for Snippets for Fast Responses and TemplatingRich Armstrong2011-11-03T17:32:31Z2012-09-21T15:28:47Z<p>Snippets can be used in any text field in a case, but they're most useful for replies to emails.</p>
<p>The snippet activation key defaults to `. It is changeable on a per-user basis in <strong>My Settings > Options</strong>. If you have a non-English keyboard layout, you might find the regular snippet key doesn't work. If so, just change to one of the other keys.</p>
<p>Let's say you've got this snippet, which you call, <code>upgrade</code>:</p>
<blockquote>
<p>Hi there,</p>
<p>Thanks for reporting this bug! Fortunately, we've already fixed it in the most recent version of the software, Frogger [[version]].</p>
<p>If there's anything else we can do for you, or if upgrading doesn't fix the issue, please just reply to this email and we'll figure out what's going on.</p>
<p>{username} - Frogger Software</p>
</blockquote>
<p>To activate it, you can either type the snippet name and then the snippet key:</p>
<p><code>upgrade</code>`</p>
<p>Or you can type the snippet key twice, which will bring up a snippet search box.</p>
<p>The text from the <code>upgrade</code> snippet will be inserted, plus you can include one a placeholder like <code>[[version]]</code> per snippet. That portion of the text will be immediately highlighted, so the next thing you type will replace that text.</p>
<p>There are also placeholders, surrounded by curly braces, which will be replaced with features from the case or the user. You can even add your own placeholders via BugMonkey. We have developed <a href="http://fogbugz.stackexchange.com/questions/6167/snippet-placeholder-for-first-name" rel="nofollow">a customization</a> we use to extract the user's first name from their email.</p>
<h2>Snippet Placeholders</h2>
<p>There are also many placeholders you can put in snippets that will be replaced automatically. All of these are available for mailbox autoreplies, too:</p>
<ul>
<li>{case} for the case ID</li>
<li>{sender} for the sender's email address</li>
<li>{subject} for the subject of the message</li>
<li>{ticket} for the external ticket ID</li>
<li>{ticket_singlecase} for the external ticket ID that only has access to the current case (not other cases submitted by the same person)</li>
<li>{url} for the URL of the FogBugz install</li>
<li>{ticketurl} for a link to the external case (e.g. http://try.fogbugz.com/default.asp?[ticket])</li>
<li>{ticketurl_singlecase} for a link to the external case (e.g. http://try.fogbugz.com/default.asp?[ticket_singlecase])</li>
<li>{username} for the name of the logged on user</li>
<li>{useremail} for the email of the logged on user</li>
</ul>
<h2>Snippet Administration</h2>
<p>Snippets can either be personal to the user or global, if added as such by an administrator. Users often run into the problem that global snippets proliferate and become hard to manage. The search box and the notes field come in handy here.</p>
<p>Rather than offering some sort of snippet group administration interface, which would further complicate the product, we recommend putting a code in the <strong>Notes</strong> field for the global snippets. The user can then type this code in to the search box and restrict their snippets to that subset. For instance, the code <code>KLN</code> could be added to all Kiln snippets, and the code <code>FBZ</code> to all FogBugz snippets.</p>