Quantcast
Channel: Quality Center / ALM Practitioners Forum topics
Viewing all articles
Browse latest Browse all 5491

Update Defect via C# OTA API

$
0
0

Hi,

As i am newbie, i want to know on how to update an exisiting defect values using OTA API (C#). i have searched KB and API documentation guide,there are codes available in VB.net and i couldnt find any steps to do in C#.

I tried manually to convert VB.net code to C# code but i couldnt able to build successfully.

Suggest me an answer.

 

Update : So after some research i have tried this code to update defect through OTA API. Build is Successfull but when i do Run, it throws type casting error message on the line "bFilter=bugF.Filter "( All object types are IBUGFACTORY2 except bugF-[bugfactory] )

 

public void updatedefect(uint index)
{

int dID = 119;
bugF = (IBugFactory2)conn.BugFactory;
bFilter = bugF.Filter;
bFilter.Filter["BG_BUG_ID"] = dID;
blist = (IBugFactory2)bFilter.NewList("");
bugItem = blist[1];
DateTime saveNow = DateTime.Now;

// Populate the mandatory fields.
bugItem.Summary = "This is a summarySummary" + index;
bugItem.DetectedBy = "bankadmin";
bugItem.Priority = "2-Medium";
bugItem.Status = "New";
bugItem["BG_DETECTION_DATE"] = saveNow;
bugItem["BG_SEVERITY"] = "2-Medium";
bugItem["BG_DESCRIPTION"] = "This is a description" + index;

//Post the bug
bugItem.Post();

}

 

Please Can anyone imrpove the code.


Viewing all articles
Browse latest Browse all 5491

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>