Thursday, August 4, 2011

Quality Center API

Below is the code to add user to the group using AUTOIT.

$objOTAapi = ObjCreate("tdapiole80.tdconnection")
$m_Server="http://<Server Name>:8080/qcbin/"
$m_User="<User Name>"
$m_password="<Password>"
$objOTAapi.InitConnectionEx($m_Server)
$objOTAapi.Login($m_User,$m_password)
$value=$objOTAapi.LoggedIn
ConsoleWrite($value)

$objOTAapi.Connect($sDomainName, $sProjectName)
$value2=$objOTAapi.ProjectConnected
ConsoleWrite($value2)

$cust =ObjCreate("tdapiole80.Customization")
$Users =ObjCreate("tdapiole80.CustomizationUsers")
$User=ObjCreate("tdapiole80.CustomizationUser")
$cust = $objOTAapi.Customization
$Users = $cust.Users
$User= $Users.User($UserName)
$User.AddToGroup ($Role)
$cust.commit
$objOTAapi.Disconnect

1 comment:

  1. Nice Article Keep on Posting...
    Thanks
    Amarnath Polu.

    ReplyDelete