I fiddled around today and got custom placeholders working for us for first names in email. I put this in our BugMonkey script:
if (goBug) {
var oFirstName = new Object();
oFirstName.sPlaceHolder = "{firstname}";
sFirstName = goBug.sCustomerEmail.match(/"(\w+)[^,@]*?" <[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}>/);
if (sFirstName) {
oFirstName.sValue = sFirstName[1];
} else {
oFirstName.sValue = "[[name]]";
}
rgPlaceHolders.push(oFirstName);
}
If you then make a snippet that says:
Hi {firstname},
It will come out differently based on whether that regex pulled out a first name. Either this:
Hi Joel,
Or this:
Hi [[name]],
[[name]] will be automatically highlighted by FogBugz so that you can type in the person's name.
You could do this with any arbitrary value for the bug, or really anywhere in the DOM. We don't have a use for this, but I just threw together this one, which makes a placeholder for the number of BugzScout occurrences a bug has:
if (goBug) {
var oPlaceHolder = new Object();
oPlaceHolder.sPlaceHolder = "{occurrences}";
oPlaceHolder.sValue = (goBug.c + 1).toString();
rgPlaceHolders.push(oPlaceHolder);
}
If you wanted to have a value that got changed only infrequently, you could put a literal value in the Javascript of the page like this:
var oPlaceHolder = new Object();
oPlaceHolder.sPlaceHolder = "{currentversion}";
oPlaceHolder.sValue = "FogBugz 8.0.26";
rgPlaceHolders.push(oPlaceHolder);
Because autoreplies are generated without having loaded the user interface, the Javascript won't run. You're still limited to the built-in placeholders there.