function main()

in js/details.js [47:198]


function main(json) {
  NeedInfoConfig = json.bugzillaconfig;
  NeedInfoConfig.developers = {};

  updateDomains();

  // user bugzilla id
  let userId = getUserId();
  if (userId == undefined) {
    console.log("missing user id url parameter.")
    return;
  }

  // odr, cdr, onb, cnb
  let userQuery = getUserQuery();
  if (userQuery == undefined) {
    console.log("missing user query url parameter.")
    return;
  }

  loadSettingsInternal();
  updateButtonsState();
  prepPage(userQuery);

  let id = encodeURIComponent(getUserId());

  //////////////////////////////////////////
  // Base query and resulting fields request
  //////////////////////////////////////////

  // v1={id}
  // o1=equals
  // f1=requestees.login_name

  // f2=flagtypes.name
  // o2=equals
  // v2=needinfo?

  let url = NeedInfoConfig.bugzilla_search_url;
  if (NeedInfoConfig.api_key.length > 0) {
    url += "api_key=" + NeedInfoConfig.api_key + "&";
  }
  url += NeedInfoConfig.bugs_query.replace("{id}", id);

  url += getBugzillaMaxDateQuery();

  switch (userQuery) {
    //////////////////////////////////////////
    // Open Developer Related
    //////////////////////////////////////////
    case 'odr':
      url += "&f3=setters.login_name";
      url += "&o3=nowordssubstr";
      url += "&v3=release-mgmt-account-bot%40mozilla.tld";

      // Ignore needinfos set by the account we're querying for.
      if (NeedInfoConfig.ignoremyni) {
        url += "," + id;
      }

      url += "&f4=bug_status";
      url += "&o4=nowordssubstr";
      url += "&v4=RESOLVED%2CVERIFIED%2CCLOSED";
      break;

    /////////////////////////////////////////////////////////
    // Open and Tracked
    // Query uses the generic tag names that bugzilla maps
    // to the current version tags.
    /////////////////////////////////////////////////////////
    case 'otr':

    // f4=bug_status
    // o4=nowordssubstr / anywordssubstr
    // v4=RESOLVED%2CVERIFIED%2CCLOSED

    url += "&f3=bug_status";
    url += "&o3=nowordssubstr";
    url += "&v3=RESOLVED%2CVERIFIED%2CCLOSED";

    // f5=cf_tracking_firefox_beta
    // o5=anywords
    // v5=%2B

    url += '&f4=OP';

    url += '&j4=OR';

    url += "&f5=cf_tracking_firefox_nightly";
    url += "&o5=anywords";
    url += "&v5=%2B";

    url += "&f6=cf_tracking_firefox_beta";
    url += "&o6=anywords";
    url += "&v6=%2B";

    url += "&f7=cf_tracking_firefox_release";
    url += "&o7=anywords";
    url += "&v7=%2B";

    url += '&f8=CP'
    break;

    //////////////////////////////////////////
    // Closed Developer Related
    //////////////////////////////////////////
    case 'cdr':
      url += "&f3=setters.login_name";
      url += "&o3=notequals";
      url += "&v3=release-mgmt-account-bot%40mozilla.tld";

      url += "&f4=bug_status";
      url += "&o4=anywordssubstr";
      url += "&v4=RESOLVED%2CVERIFIED%2CCLOSED";

      // Ignore needinfos set by the account we're querying for.
      if (NeedInfoConfig.ignoremyni) {
        url += "&f5=setters.login_name";
        url += "&o5=notequals";
        url += "&v5=" + id;
      }
      break;

    //////////////////////////////////////////
    // Open Nagbot
    //////////////////////////////////////////
    case 'onb':
      url += "&f3=setters.login_name";
      url += "&o3=equals";
      url += "&v3=release-mgmt-account-bot%40mozilla.tld";

      url += "&f4=bug_status";
      url += "&o4=nowordssubstr";
      url += "&v4=RESOLVED%2CVERIFIED%2CCLOSED";
      break;

    //////////////////////////////////////////
    // Closed Nagbot
    //////////////////////////////////////////
    case 'cnb':
      url += "&f3=setters.login_name";
      url += "&o3=equals";
      url += "&v3=release-mgmt-account-bot%40mozilla.tld";

      url += "&f4=bug_status";
      url += "&o4=anywordssubstr";
      url += "&v4=RESOLVED%2CVERIFIED%2CCLOSED";
      break;
  }

  retrieveInfoFor(url, userQuery);
}