HowTo: Quality Center / REST API / VBScript – Delete an entity by ID
Question ID: 105773
1
0

How Do I delete an entity (such as a defect) using REST API / VBScript?

Marked as spam
Posted by (Questions: 122, Answers: 3)
Asked on January 2, 2015 7:00 pm
103 views
Answers (1)
1
Private answer

**Example:**

Sub DeleteEntityID()

Dim ALMServer, ALMDomain, ALMProject, EntityType, EntityID, XMLHttpRequestObj

ALMServer = ''http://localhost:8080/qcbin'' ''<--No trailing slash ALMDomain = ''DEFAULT'' ALMProject = ''ALM_DEMO'' EntityType = ''defect'' ''<--Singular, no ''s'' (defect, design-step, requirement, run, run-step, test, test-set) EntityID = ''1'' Set XMLHttpRequestObj = CreateObject(''Msxml2.ServerXMLHTTP.6.0'') XMLHttpRequestObj.open ''DELETE'', ALMServer & ''/rest/domains/'' & ALMDomain & ''/projects/'' & ALMProject & ''/'' & EntityType & ''s/'' & EntityID, False XMLHttpRequestObj.setRequestHeader ''Accept'',''application/xml'' XMLHttpRequestObj.send MsgBox ''-- Delete Entity ID --'' & vbCrLf & _ ''Status Code : '' & XMLHttpRequestObj.status & vbCrLf & _ ''Status Text : '' & XMLHttpRequestObj.statusText & vbCrLf & _ ''-------------------'' & vbCrLf & _ ''Response Text : '' & vbCrLf & XMLHttpRequestObj.responseText, , ''Delete Entity'' Set XMLHttpRequestObj = Nothing End Sub

Marked as spam
Posted by (Questions: 3, Answers: 168)
Answered on January 2, 2015 7:02 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top