[% BLOCK changes_link;
     # vars that need to be set by caller or document:
     # changes_app: "seamonkey" or "thunderbird"
     # changes_product (optional): e.g. "MailNews%20Core"
     # changes_ver: e.g. "232" or "35"
     # changes_prev (optional): e.g. "231" or "34"
     # changes_prevprev (optional): e.g. "230" or "33"
     # changes_tm: e.g. "2.32" or "35.0"

     UNLESS changes_prev.defined;
       changes_prev = changes_ver - 1;
     END;
     UNLESS changes_prevprev.defined;
       changes_prevprev = changes_prev - 1;
     END;

     IF changes_app == "seamonkey";
       flag_prefix = "cf_status_seamonkey";
       tm_prefix = "seamonkey";
     END;
     IF changes_app == "thunderbird";
       flag_prefix = "cf_status_thunderbird_";
       tm_prefix = "Thunderbird%20";
     END;

     "https://bugzilla.mozilla.org/buglist.cgi?o5=notequals&f1=OP&v6=fixed&o3=equals&v3=fixed&resolution=FIXED&o6=notequals&o2=equals&f4=CP&v5=fixed&query_format=advanced&j1=OR&f3=${flag_prefix}${changes_ver}&f2=target_milestone&f5=${flag_prefix}${changes_prev}&f6=${flag_prefix}${changes_prevprev}&v2=${tm_prefix}${changes_tm}";

     IF changes_product;
       "&product=${changes_product}";
     END;
   END;
%]
