Error in deleting test cases using Azure DevOps extension API

Copper Contributor

Hello DevOps Team,

 

I have created an extension to delete the Test runs and Test cases in bulk. I'm able to delete the Test runs from separate hub page. For deleting test cases, We have created an (ms.vss-web.action) web action to query result windows on following target (ms.vss-work-web.query-result-work-item-menu). When user are deleting the test cases, its giving following error.

 

Extension have following scopes: [vs.test, vso.test_write]

 

Debugging:

Before deleting test case, I have also tired reading & deleting the TestRun to check, if that's is also failing. But it ran successfully. But when deleting the test case, it just fail with following above errors. I have all the associated right on the DevOps Server. 

 

Code.

async function DeleteTestCasebyId(projectId:string, testCaseId:number): Promise<boolean>{

try{

 const result = await getClient(TestRestClient).deteteTestCase(projectId,testCaseId);

 return true;

}catch(e){

console.log(e);

return false;

}

}

 

Could please point what's the right solution for this?

 

Regards,

Ajit

 

0 Replies