Highlighted
Absent Member.
Absent Member.
1159 views

(IBug)factory.AddItem(null) method to create Bug does not work for ALM 11

Hi,

 

I am running the C# code new bug in ALM 11.

 

 

The code below is working fine for QC10 but does not work for ALM 11.

  

publicIBugCreateIssue()

{

 

 IBugFactory factory = (IBugFactory)m_connection.BugFactory;

 IBug bug = (IBug)factory.AddItem(0L);

 return bug;

}

 

When I run above code for  ALM 11, it gives error as Invalid Parameter type.

I tried options such as AddItem(null), AddItem(""), AddItem(0), but it gives same error.

 

I changed it to 

 IBug bug = (IBug)factory.AddItem(System.DBNull.Value);  for ALM 11.

It does not throw any error, but bug is not created in ALM.

It gives bugid as -10, every time I run the code to create new Bug.

 

 

Please help me with the solution.

0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Instead of passing null try passing System.DBNull.Value

Phil Trostel
0 Likes
Highlighted
Absent Member.
Absent Member.

Hi,

I have already tried it, but is  not working for me.

It gives the bugid with value -10.

 

 

Please help.

0 Likes
Highlighted
Absent Member.
Absent Member.

Hello,

 

try to ".post" the bug. Only after a post you can get the bug id.

 

Regards,

--
Forj: continuous integration & delivery for the masses
http://www.hp.com/go/forj
Do not hesitate to mark a question as closed if you think you have all you need (Kudos do help too 🙂 )
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.