This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1031560 - How to create external bugs for a red hat bug using XML RPC
How to create external bugs for a red hat bug using XML RPC
Status: CLOSED NOTABUG
Product: Bugzilla
Classification: Community
Component: WebService (Show other bugs)
4.4
All All
unspecified Severity high (vote)
: ---
: ---
Assigned To: PnT DevOps Devs
tools-bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-18 04:57 EST by Yi Chun Chen
Modified: 2013-11-18 18:22 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-18 18:22:09 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Yi Chun Chen 2013-11-18 04:57:26 EST
Hi, I want to create an external bug for a red hat bug using XML RPC, and I wrote:


    public void createExternalBug(String bugID,String extSysID,String extBugID)
    throws DoggierException{
    	if(client==null){
    		throw new DoggierException(301,theURL);
    	}
    	if(!isLoggedIn){
    		throw new DoggierException(302,theURL);
    	}
    	Integer bugid=null;
    	Integer extBZID=null;
    	Integer extbugID=null;
    	try{
    	    bugid=new Integer(bugID);
    	    extBZID=new Integer(extSysID);
    	    extbugID=new Integer(extBugID);
    	}catch(NumberFormatException e){
    		throw new DoggierException(303,bugID);
    	}
    	HashMap hm=new HashMap();
    	hm.put("bug_id",bugID);
    	hm.put("ext_bz_id",extSysID);
    	hm.put("ext_bz_bug_id",extBugID);
    	try{
    	    client.execute("ExternalBugs.create",new Object[]{hm});
    	}catch(XmlRpcException e){
    		e.printStackTrace();
    		throw new DoggierException(347,e.getMessage(),theURL);
    	}
    }


But errors seems:

org.apache.xmlrpc.client.XmlRpcClientException: Failed to parse servers response: java.lang.String cannot be cast to java.lang.Integer
	at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:177)
	at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:145)
	at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:94)
	at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:44)
	at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)
	at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)
	at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:136)
	at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125)
	at com.ibm.cde.bugzilla.custom.api.XMLDoger.createExternalBug(XMLDoger.java:651)
	at com.ibm.cde.bugzilla.custom.api.XMLDoger.main(XMLDoger.java:667)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
	at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1194)
	at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:175)
	... 9 more

Do you know how should I write code to create external bug using XML RPC?

Quite urgent for our deployment of distros bridge!

Thanks!
Comment 1 Simon Green 2013-11-18 18:22:09 EST
The Red Hat Bugzilla team do not provide support for Bugzilla.

The documentation for adding and updated external trackers is here
https://bugzilla.redhat.com/docs/en/html/api/extensions/ExternalBugs/lib/WebService.html

Other API documentation can be accessed from
https://bugzilla.redhat.com/docs/en/html/api/

Note You need to log in before you can comment on or make changes to this bug.