In the Bugzilla Bug and Comment publication forms, we use Handlebars.js to dynamically render variables in the following fields:
- For bug publication: Custom fields & Description.
- For comment publication: Comment.
To use a Handlebars variable (as the ones listed below), you have to surround your variable with double curly brackets:
{{myvariable}}
By default, Handlebars will HTML escape the text to be rendered. If you want to render your variable as unescaped HTML, you can surround it with triple curly brackets or append a & character before its name:
{{{myvariable}}}
{{&myvariable}}
Presuming that var is a Handlebars variable and that its stored value is:
<h1>
My beautiful variable
</h1>
The following input:
{{var}}
---
{{{var}}}
---
{{&var}}
---
{{=<% %>=}}
{{var}}
<%={{ }}=%>
Will render as this output:
<h1>
My beautiful variable
</h1>
---
<h1>
My beautiful variable
</h1>
---
<h1>
My beautiful variable
</h1>
---
{{var}}
To learn more about Handlebars variables, please read the documentation.
Note: All fields are immutable unless otherwise specified.
summary- Renders the text displayed in Summary
<input/> - Value is editable through the Summary form field
- Renders the text displayed in Summary
shortsigRenders the CrashEntryshortSignatureattributeproductRenders the CrashEntryproductattributeversionRenders the CrashEntryproduct_versionattribute if set, else display the following hint:"(Version not available)"argsRenders the CrashEntryargsattribute as JSONosRender the CrashEntryosattributeplatformRenders the CrashEntryplatformattributeclientRenders the CrashEntryclientattributetestcase- If the CrashEntry
testcaseattribute is empty, it displays the following hint:"(Test not available)" - Else if the
testcasecontent length is greater than 2048 characters or contains binary content, it displays the following hint:"See attachment." - Else, it simply renders the
testcasecontent - Value is editable through the Content field located in the Testcase form section
- If the CrashEntry
crashdata- If the CrashEntry
rawCrashDataattribute is set, it renders its content - Else, it renders the CrashEntry
rawStderrattribute content - Value is editable through the Content field located in the Crash data form section
- If the CrashEntry
crashdataattached- If the crash data is to be attached to the bug, it displays the following hint:
"For detailed crash information, see attachment." - Else, it displays:
"(Crash data not available)" - Value is editable through the Do not attach crash data checkbox located in the Crash data form section
- If the crash data is to be attached to the bug, it displays the following hint:
metadata*- The
*is to be replaced with a metadata name - If the metadata is available in CrashEntry
metadataattribute as an object key, it renders the value ofCrashEntry.metadata[name] - Else, it renders the following hint:
"(metadata{name} not available)" - e.g: With
CrashEntry.metadata = {"path": "test/path"},{{metadatapath}}renders to"test/path"and{{metadataunknown}}renders to"(metadataunknown not available)"
- The
metadata*- The
*is to be replaced with a metadata name - If the metadata is available in CrashEntry
metadataattribute as an object key, it renders the value ofCrashEntry.metadata[name] - Else, it renders the following hint:
"(metadata{name} not available)" - e.g: With
CrashEntry.metadata = {"path": "test/path"},{{metadatapath}}renders to"test/path"and{{metadataunknown}}renders to"(metadataunknown not available)"
- The
Note: All fields are immutable unless otherwise specified.
summaryRenders the BugzillaTemplatesummaryattribute if set, else renders the CrashEntryshortSignatureattributeshortsigRenders the CrashEntryshortSignatureattributeproductRenders the CrashEntryproductattributeversionRenders the CrashEntryproduct_versionattribute if set, else display the following hint:"(Version not available)"argsRenders the CrashEntryargsattribute as JSONosRender the CrashEntryosattributeplatformRenders the CrashEntryplatformattributeclientRenders the CrashEntryclientattributetestcase- If the CrashEntry
testcaseattribute is empty, it displays the following hint:"(Test not available)" - Else if the
testcasecontent length is greater than 2048 characters or contains binary content, it displays the following hint:"See attachment." - Else, it simply renders the
testcasecontent - Value is editable through the Content field located in the Testcase form section
- If the CrashEntry
crashdata- Renders the CrashEntry
rawCrashDataattribute if set - Else, it renders the CrashEntry
rawStderrattribute content - Value is editable through the Content field located in the Crash data form section
- Renders the CrashEntry
crashdataattached- If the crash data is to be attached to the bug, it displays the following hint:
"For detailed crash information, see attachment." - Else, it displays:
"(Crash data not available)" - Value is editable through the Do not attach crash data checkbox located in the Crash data form section
- If the crash data is to be attached to the bug, it displays the following hint:
metadata*- The
*is to be replaced with a metadata name - If the metadata is available in CrashEntry
metadataattribute as an object key, it renders the value ofCrashEntry.metadata[name] - Else, it renders the following hint:
"(metadata{name} not available)" - e.g: With
CrashEntry.metadata = {"path": "test/path"},{{metadatapath}}renders to"test/path"and{{metadataunknown}}renders to"(metadataunknown not available)"
- The