Highlighted
Visitor.
526 views

Adding new bug with custom field using OTAClient.dll 12.53 [C#]

I have a a class function from the documentation to add a test bug using OTA where bugF is of type IBugFactory2:

public void addBug2Project(uint index)
{
bugF = conn.BugFactory;
bugItem = (IBug2)bugF.AddItem(DBNull.Value);

DateTime saveNow = DateTime.Now;

// Populate the mandatory fields.
bugItem.Summary = "This is a summary" + index;
bugItem.DetectedBy = "doe_john";
bugItem.Priority = "3-Medium";
bugItem.Status = "New";

bugItem["USER-15"] = "Test";

//Post the bug
bugItem.Post();
}

The code fails on bugItem["USER_15"]. I want the bug to be created with user defined field "user-15" to be "Test"

In my DLL, there is no property definition for "Field" (bugItem.Field() isn't defined). according to the documentation, IBug2 is supposed to have a field public property. Where is it? 

 

OTAClient: 12.53.2.0_952

 

 

0 Likes
2 Replies
Highlighted
Honored Contributor.
Honored Contributor.

Looking at the Samples in the 12.55:  https://admhelp.microfocus.com/alm/en/12.55/api_refs/ota/webframe.html#topic79.html

You should be using

BugItem.Field("USER-15") = "Test"

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

And probably 

BugItem.Field("BG_USER_15") = "Test"

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.