Search code examples
jenkinshp-quality-center

Creating defects in QC from Jenkins when build fails


I'm running Jenkins in Linux and I want to raise defects in QC when the build fails. What's the easiest way to do that?


Solution

  • QC has a REST API that you can use, actually with anything that talks via HTTP, e.g.

    curl -b qc_cookies -c qc_cookies -u <USERNAME:PASSWORD> http://<QC_SERVER:PORT>/qcbin/authentication-point/authenticate
    
    curl -b qc_cookies -c qc_cookies -H "Content-Type: application/xml" -X POST -d @<QC_DEFECT_PAYLOAD.xml> http://<QC_SERVER:PORT>/qcbin/rest/domains/<DOMAIN>/projects/<PROJECT>/defects
    
    curl -b qc_cookies -c qc_cookies http://<QC_SERVER:PORT>/qcbin/authentication-point/logout
    

    More details on how to use it with Jenkins can be found at http://antagonisticpleiotropy.blogspot.com.au/2014/02/jenkins-hps-alm-quality-center-qc-rest.html