Jira Sample

This sample demonstrate the access to services from the issue tracking system JIRA. It is the first test (experiment) with the JIRA version 3.2.x.. On the Jira web side you can see the description of a example.

Advantages from the Crispy-JiraService

  • The same call from Web-Service and XML-RPC.
  • The return value from XML-RPC are concrete (Jira) objects (otherwise are it Vector or Hashtable).
  • All calls are simple Jave Object calls.
  • The Login-Token must never used. The token is only use in background and not to see for the user.

Quick Start

A simple and rapid way to use a JIRA client is to use the class net.sf.crispy.sample.jira.Run

  1. Edit the property: jira.properties (the file is, where the class net.sf.crispy.sample.jira.Run is)
  2. Execute the main-method in the class net.sf.crispy.sample.jira.Run.

The conrete steps are:

  1. The properties are:
    # the user to login
    crispy.sample.user=soaptester 					
    # the password to login
    crispy.sample.passwd=soaptester					
    # a issue to search
    crispy.sample.issue=TST-2184
    # when the service is a Web-Service
    crispy.sample.url=http://atlassian01.contegix.com:10083/rpc/soap	
    # OR
    # when the service is a XML-RPC-Service
    # crispy.sample.url=http://atlassian01.contegix.com:10083/rpc/xmlrpc	
    
  2. Run the main-method:
    	
    java -classpath [libs] net.sf.crispy.sample.jira.Run
    

Libs for the JIRA-client:

Libs for XML-RPC-Client:
  • commons-codec-1.2.jar
  • commons-httpclient-2.0.2.jar
  • servlet.jar
  • xmlrpc-1.2-b1.jar
  • commons-logging.jar
Libs for Web-Service-Client Axis:
  • axis.jar-1.2.1.jar
  • commons-discovery-0.2.jar
  • jaxrpc.jar
  • saaj.jar
  • wsdl4j-1.5.1.jar
  • commons-logging.jar

Your own application

  1. Create Properties:
    Properties props = new Properties();
    props.put(Property.REMOTE_URL_AND_PORT, http://atlassian01.contegix.com:10083/rpc/soap);
    
  2. Create ServiceManager and Service instance:
    IServiceManager serviceManager = new JiraServiceManager(props, JiraServiceManager.SOAP_SERVICE);
    JiraService jiraService = (JiraService) serviceManager.createService(JiraService.class);
    
  3. Login on the jira-server:
    jiraService.login("user", "passwd");
    
  4. Invoke service-methods:
    RemoteUser ru = jiraService.getUser("user");
    System.out.println("User: " + ru.getName() + " " 
    				+ ru.getFullname() 
    				+ " " + ru.getEmail());		
    
    RemoteProject remoteProjects[] = jiraService.getProjects();
    for (int i = 0; i < remoteProjects.length; i++) {
    	System.out.println(remoteProjects[i].getId() + " " 
    				+ remoteProjects[i].getName() + " " 
    				+ remoteProjects[i].getDescription() + " "
    				+ remoteProjects[i].getKey() + " "
    				+ remoteProjects[i].getLead() + " " 
    				+ remoteProjects[i].getProjectUrl());	
    }		
    
    
  5. After all calls you can logout:
    jiraService.logout();