Bug 1031560 - How to create external bugs for a red hat bug using XML RPC
Summary: How to create external bugs for a red hat bug using XML RPC
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Bugzilla
Classification: Community
Component: WebService
Version: 4.4
Hardware: All
OS: All
unspecified
high
Target Milestone: ---
Assignee: PnT DevOps Devs
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-18 09:57 UTC by Yi Chun Chen
Modified: 2013-11-18 23:22 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-18 23:22:09 UTC
Embargoed:


Attachments (Terms of Use)

Description Yi Chun Chen 2013-11-18 09:57:26 UTC
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 23:22:09 UTC
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.