Root > Solving bugs in your code > Managing bug reports in issue tracker > Bug trackers setup > FogBugz setup > Using HTTP upload

Using HTTP upload

Previous pageReturn to chapter overviewNext page   

This article is part of Managing bug report in issue tracker series.

 

FogBugs allows you to submit reports anonymously without using API. This is an alternative method to submit bug reports.

 

Note: anonymous submitting may be disabled - please, refer to your FogBugz configuration and documentation.

 

However, FogBugz doesn't allow you to login anonymously via FogBugz API. So, the only choice for anonymous reporting is to submit report directly to web form (web-form for anonymous users is available at this URL: https://your-account.fogbugz.com/default.asp?pg=pgPublicEdit - with user logged off).

 

Warning: each sent report will be tracked individually - as new issue in FogBugz. Occurrences field will be 1 always, for all such reports.

 

Alternatively, you can use BugzScout submission. This way also allows anonymous access, but it also automates merging similar reports. However, file attaches are not supported.

 

Below are examples for each method.

 

 

Web-form

First, start with specifying HTTP upload method:

 

 

Typical HTTP upload setup for submitting report anonymously in FogBugz

 

URL is "your-account.fogbugz.com/default.asp?pre=preSubmitBug" (without quotes).

 

Second, you need to supply custom fields (it's only an example - use your own values for fields):

 

uses

  EEvents, ETypes, EClasses, ESend, ESendWebHTTP;

 

procedure SetCustomFields(const ACustom: Pointer; const ASender: TObject; const AWebFields: TStrings; var ACallNextHandler: Boolean);

 

  function ComposeTitle(const AOptions: TEurekaModuleOptions): String;

  var

    BugAppVersion: String;

    BugType: String;

    BugID: String;

  begin

    BugAppVersion := AOptions.CustomField[sifBugAppVersion];

    BugType := AOptions.CustomField[sifBugType];

    BugID := AOptions.CustomField[sifBugID];

 

    if BugAppVersion <> '' then

      Result := Format('%s (Bug %s; v%s)', [BugType, BugID, BugAppVersion])

    else

      Result := Format('%s (Bug %s)', [BugType, BugID]);

  end;

 

  function ComposeMessage(const AOptions: TEurekaModuleOptions): String;

  var

    TrackerAppendText: Boolean;

    BugText: String;

    ReproduceText: String;

    MessageString;

  begin

    TrackerAppendText := AOptions.SendFogBugzAppendText;

    BugText := AOptions.CustomField[sifBugText];

    ReproduceText := AOptions.CustomField[sifStepsToReproduce];

    Message := AOptions.CustomField[sifMessage];

 

    if TrackerAppendText then

      Result := BugText + sLineBreak + sLineBreak + Message

    else

    if ReproduceText <> '' then

      Result := BugText + sLineBreak + sLineBreak + ReproduceText

    else

      Result := BugText;

  end;

 

var

  Options: TEurekaModuleOptions;

  AttachedFiles: TStringList;

begin

  Options := nil;

  AttachedFiles := TStringList.Create;

  try

    if ASender is TELUniversalSender then

    begin

      Options := TELUniversalSender(ASender).Options;

      AttachedFiles.Assign(TELUniversalSender(ASender).AttachedFiles);

    end

    else

      Options := TEurekaModuleOptions.Create('');

 

    // hidden fields:

    AWebFields.Values['command'] := 'new';

    AWebFields.Values['honeyInput'] := '';

    AWebFields.Values['honeyTextArea'] := '';

    AWebFields.Values['ixScreenshot'] := '-1';

    AWebFields.Values['dblTimeStamp'] := FloatToStr(Now);

    AWebFields.Values['fPublic'] := '1';

    AWebFields.Values['OK'] := 'OK';

 

    // fixed fields:

    AWebFields.Values['sTitle'] := ComposeTitle(Options);

    AWebFields.Values['sEvent'] := ComposeMessage(Options);

    AWebFields.Values['sCustomerEmail'] := Options.CustomField[sifUserEMail];

    AWebFields.Values['sVersion'] := Options.CustomField[sifBugAppVersion];

    AWebFields.Values['sComputer'] := Options.CustomField[sifMachineID];

    AWebFields.Values['nFileCount'] := IntToStr(AttachedFiles.Count);

    Options.CustomField[sifHTTPFileNameTemplate] := 'File%d';

 

    // editable fields - refer to page source (https://your-account.fogbugz.com/default.asp?pg=pgPublicEdit)

    AWebFields.Values['ixProject'] := '3';

    AWebFields.Values['ixArea'] := '8';

 

  finally

    FreeAndNil(AttachedFiles);

    if not (ASender is TELUniversalSender) then

      FreeAndNil(Options);

  end;

end;

 

initialization

  RegisterEventCustomWebFieldsRequest(nil, SetCustomFields);

end.

 

Done!

 

Note: study submission form's page source to get information on field names and values. Form is available at https://your-account.fogbugz.com/default.asp?pg=pgPublicEdit with user logged off.

 

 

BugzScout

First, start with specifying HTTP upload method. It's the same as above, only this time URL is "your-account.fogbugz.com/scoutSubmit.asp" (without quotes).

 

Second, you need to supply custom fields (it's only an example - use your own values for fields):

 

uses

  EEvents, ETypes, EClasses, ESend, ESendWebHTTP;

 

procedure SetCustomFields(const ACustom: Pointer; const ASender: TObject; const AWebFields: TStrings; var ACallNextHandler: Boolean);

 

  function ComposeTitle(const AOptions: TEurekaModuleOptions): String;

  var

    BugAppVersion: String;

    BugType: String;

    BugID: String;

  begin

    BugAppVersion := AOptions.CustomField[sifBugAppVersion];

    BugType := AOptions.CustomField[sifBugType];

    BugID := AOptions.CustomField[sifBugID];

 

    if BugAppVersion <> '' then

      Result := Format('%s (Bug %s; v%s)', [BugType, BugID, BugAppVersion])

    else

      Result := Format('%s (Bug %s)', [BugType, BugID]);

  end;

 

  function ComposeMessage(const AOptions: TEurekaModuleOptions): String;

  var

    TrackerAppendText: Boolean;

    BugText: String;

    ReproduceText: String;

    MessageString;

  begin

    TrackerAppendText := AOptions.SendFogBugzAppendText;

    BugText := AOptions.CustomField[sifBugText];

    ReproduceText := AOptions.CustomField[sifStepsToReproduce];

    Message := AOptions.CustomField[sifMessage];

 

    if TrackerAppendText then

      Result := BugText + sLineBreak + sLineBreak + Message

    else

    if ReproduceText <> '' then

      Result := BugText + sLineBreak + sLineBreak + ReproduceText

    else

      Result := BugText;

  end;

 

var

  Options: TEurekaModuleOptions;

  AttachedFiles: TStringList;

begin

  Options := nil;

  AttachedFiles := TStringList.Create;

  try

    if ASender is TELUniversalSender then

    begin

      Options := TELUniversalSender(ASender).Options;

      AttachedFiles.Assign(TELUniversalSender(ASender).AttachedFiles);

    end

    else

      Options := TEurekaModuleOptions.Create('');

 

    AWebFields.Values['ScoutUserName'] := 'AutoReporter';

    AWebFields.Values['ScoutProject'] := 'Bug reports';

    AWebFields.Values['ScoutArea'] := 'Misc';

    AWebFields.Values['Description'] := ComposeTitle(Options);

    AWebFields.Values['Extra'] := ComposeMessage(Options);

    AWebFields.Values['Email'] := Options.CustomField[sifUserEMail];

    AWebFields.Values['ForceNewBug'] := '0';

    AWebFields.Values['ScoutDefaultMessage'] := 'html Default Message';

    AWebFields.Values['FriendlyResponse'] := '1';

  finally

    FreeAndNil(AttachedFiles);

    if not (ASender is TELUniversalSender) then

      FreeAndNil(Options);

  end;

end;

 

initialization

  RegisterEventCustomWebFieldsRequest(nil, SetCustomFields);

end.

 

Done!

 

Note: see BugzScout documentation and BugzScout sample to get information on field names.

 

 

See also:




Send feedback... Build date: 2018-11-26
Last edited: 2018-10-27
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/fogbugz_and_http_upload.php