Hi,

I have written a SubmitBug method in C#, which allows me to submit a bug to
Mantis tracking system.
It works great with one exception - it does not fill in product version
correctly, even though I am specifying it in code.
It simply leaves it blank.

Any suggestions?
Regards,

- Leonid

P.S. The file version of a DLL file I am using is 1.0.2004.240

====================================================================================

        using Futureware.MantisConnect;

        /// <summary>
        /// Submits a bug to the mantis bug tracking system
        /// </summary>
        /// <param name="summary">The summary of the bug</param>
        /// <param name="description">The description of the bug</param>
        /// <returns>The result from mantis</returns>
        public static string SubmitBug(string summary, string description) {

            string mantisConnectUrl =
"http://<addr>/mantisconnect.php";//ConfigurationSettings.AppSettings["MantisConnectUrl"];
            string mantisUserName =
"<user>";//ConfigurationSettings.AppSettings["MantisUserName"];
            string mantisPassword =
"<pass>";//ConfigurationSettings.AppSettings["MantisPassword"];
            Session session = new Session(mantisConnectUrl, mantisUserName,
mantisPassword, null);
            session.Connect();

            // Create the issue in memory
            Issue issue = new Issue();

            issue.Project = new ObjectRef("NFA Desktop Suite");
            issue.Priority = new ObjectRef("normal");
            issue.Severity = new ObjectRef("major");
            issue.Reproducibility = new ObjectRef("always");
            issue.Category = new ObjectRef("Addin");
            issue.ProductVersion = "5.1";
            issue.Summary = summary;
            issue.Description = description;
            issue.ReportedBy = new User();
            issue.ReportedBy.Name = session.Username;

            // Submit the issue and show its id
            string str = string.Empty;
            int bug_id = 0;
            try {
                str = string.Concat("Issued added as ",
session.Request.IssueAdd(issue).ToString(), ".");
            } catch (InvalidOperationException ioe) {
                string xml = ioe.Message.Substring(ioe.Message.IndexOf("<?xml
version"));
                bug_id = Convert.ToInt32(xml.Substring(xml.IndexOf("<return
xsi:type=\"xsd:integer\">") + "<return
xsi:type=\"xsd:integer\">".Length).Split('<')[0]);
                Debug.WriteLine(ioe.Message);
            }
            if (bug_id == 0)
                bug_id = Convert.ToInt32(str);

            return Convert.ToString(bug_id);
        }
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
mantisbt-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mantisbt-help

Reply via email to