Updating Issues


To update issue details use the GetIssueByNum and SaveIssue Web methods.
You need to send the issue you wish to update as a parameter to the methods.

  1. Retrieve the issue using the GetIssueByNum method.
  2. Change the value of the field(s).
  3. Save the issue using the SaveIssue method.

Below are examples that retrieve issue number 945, change the first field (Title) and save the issue.

Example in Visual Basic .Net

Try
        'create an instance of the proxy class
        Dim BTService As New Elementool.BugTrackingWse
        'Execute web method for retrieving issue details
        Dim Issue As Elementool.BugTrackingIssue = (BTService.GetIssueByNum(945))
        'if issue exist
        If Not Issue Is Nothing Then
                'Change the first field of the issue which is title
                Issue.FieldsArray(0).Value = "This is the updated title"
                'Save the issue
                BTService.SaveIssue(Issue)
                MsgBox("Issue  was successfully updated")
        Else
                MsgBox("Issue does not exist")
        End If
Catch ex As Exception
        MsgBox(ex.Message)
End Try

Example in C#

try
{
    //create an instance of the proxy class
    Elementool.BugTrackingWse BTService = new Elementool.BugTrackingWse();
    //Execute web method for retrieving issue details
    Elementool.BugTrackingIssue Issue = (BTService.GetIssueByNum(945));
    //if issue exist
    if (Issue != null)
    {
        //Change the first field of the issue which is title
        Issue.FieldsArray(0).Value = "This is the updated title";
        //Save the issue
        BTService.SaveIssue(Issue);
        MessageBox.Show("Issue was successfully updated");
    }
    else
    {
        MessageBox.Show("Issue does not exist");
    }
}
catch (Exception ex)
{
    MessageBox.Show(ex.Message);
}