History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRA-14591
Type: Bug Bug
Status: Resolved Resolved
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Timothy Chin [Atlassian]
Reporter: Lance Selvidge
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JIRA

java soap client returns a null for key after creating a remote issue

Created: 05/Mar/08 02:26 PM   Updated: 23/Mar/08 08:52 PM
Component/s: Remote API (SOAP & XML-RPC)
Affects Version/s: 3.12.2
Fix Version/s: 3.12.3

Time Tracking:
Original Estimate: Not Specified
Remaining Estimate: 0 minutes
Time Spent - 1 hour
Time Spent: 1 hour
Time Spent - 1 hour

Environment:
The jira server is running on a 'linux 2.6.9-55.ELsmp box.
On the client side I am using a linux 2.6.9-5.EL box. The client interface to the secondary jira server is via a post function plug. This client is running jira 3.10.2

Participants: Lance Selvidge, Michael Tokar [Atlassian] and Timothy Chin [Atlassian]
Since last comment: 16 weeks, 5 days ago
Resolution Date: 23/Mar/08 08:47 PM
Labels:


 Description  « Hide
just some names to keep things straight:
First jira server (3.10.2) - jira-trackit
Second jiar server (3.12.2) - jira-audit

So jira-trackit has a post function plugin that attempts to connect to jira-audit and create a new ticket. The item will successfully get created on jira-audit however I am unable to retrieve the key of the newly created item from the jira-trackit plugin.

source snip from the jira-trackit plugin:

// Run the create issue code
RemoteIssue returnedIssue = service.createIssue(fToken, rIssue);

final String rIssueKey = returnedIssue.getKey();

LogUtils.getGeneral().info("CreateRemoteIssue::execute: SOAP: new issue has been created " + rIssueKey);
LogUtils.getGeneral().info("CreateRemoteIssue::execute: SOAP: new issue has been created " + returnedIssue.getKey());
LogUtils.getGeneral().info("CreateRemoteIssue::execute: SOAP: new issue has been created project " + returnedIssue.getProject());
LogUtils.getGeneral().info("CreateRemoteIssue::execute: SOAP: new issue has been created priority " + returnedIssue.getPriority());

So again the server.createIssue() works but the returnedIssue.getKey() is always null. It is interesting to note that the other returnedIssue.getProject() and returnedIssue.getPriority() both return real values.

Also, I have a python soap client which will create an issue on jira-audit, this script will successfully retrieve the newly created jira key. So this issue appears to be specific to the java soap interface.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Timothy Chin [Atlassian] - 06/Mar/08 04:18 AM
Hi,

I have replicated this issue with 3.12.2 stubs and it does exist. The RemoteIssue object is returned but the getKey() returns null.

Regards,
Timothy


Michael Tokar [Atlassian] - 18/Mar/08 11:08 PM
I was unable to reproduce the problem with my own client code:
JiraSoapServiceService jiraSoapServiceGetter = new JiraSoapServiceServiceLocator();
URL newURL = new URL("http://jira.atlassian.com/rpc/soap/jirasoapservice-v2");

JiraSoapService jiraSoapService = jiraSoapServiceGetter.getJirasoapserviceV2(newURL);
String token = jiraSoapService.login("soaptester", "soaptester");

RemoteIssue blankIssue = new RemoteIssue();
blankIssue.setProject("TST");
blankIssue.setSummary("Test Issue created by TestSoapThingy");
blankIssue.setType("1");
RemoteIssue cIssue = jiraSoapService.createIssue(token, blankIssue);
String theNewKey = cIssue.getKey();
String theProject = cIssue.getProject();

System.out.println("Key: " + theNewKey);
System.out.println("Project: " + theProject);

I used this code in a test class inside the jira-soapclient project. I compiled the SOAP client code by checking out the latest SOAP client code from http://svn.atlassian.com/svn/public/atlassian/jira-soapclient/trunk and following the instructions in the README. The code is using http://jira.atlassian.com/ as the SOAP server, so it should be the same as the test environment described (both are running 3.12.2).

Is there something I'm missing?


Lance Selvidge - 19/Mar/08 03:48 PM

I had not tried a standalone java soap client. I download and built the one you referenced above and everything worked as expected (the getKey() method returned a real value). I modified that client to run against my server and everything still worked.

I'm not sure what the difference is when executing java from a plugin vs running as a standalone.

below is more of the client code from the plugin:

JiraSoapServiceService jiraSoapServiceGetter = new JiraSoapServiceServiceLocator();

// this keys off of the Administration->General Configuration->Base URL setting
String srcJiraURL = ManagerFactory.getApplicationProperties().getString(APKeys.JIRA_BASEURL);
				
String serverURL=jiraURI;
String endPoint="/rpc/soap/jirasoapservice-v2";
				
JiraSoapService service = jiraSoapServiceGetter.getJirasoapserviceV2(new URL(serverURL + endPoint));				
fToken = service.login(userName, password);			
				
RemoteIssue rIssue = new RemoteIssue();
							
rIssue.setProject("EHD");
rIssue.setPriority("2");												
String issueKey = issue.getKey();
rIssue.setSummary("Jira auto-request to open stream for release "+ streams +" on behalf of " + assigneeValue);
rIssue.setDescription(" Jira auto-request from Grant Promote Approval for issue " + issueKey + ". \n\n" + srcUrl +"/browse/" + issueKey);
rIssue.setAssignee(userName);
rIssue.setReporter(assigneeValue);
rIssue.setType("4");
				
// Add remote compoments
RemoteComponent component = new RemoteComponent();
component.setId("10010");
component.setName("AccuRev.Streams");
rIssue.setComponents(new RemoteComponent[]{component});	        		  		        		       		        		     
		        
// Run the create issue code
RemoteIssue returnedIssue = service.createIssue(fToken, rIssue);
final String rIssueKey = returnedIssue.getKey();
LogUtils.getGeneral().info("CreateRemoteIssue::execute: SOAP: new issue has been created " + rIssueKey);
LogUtils.getGeneral().info("CreateRemoteIssue::execute: SOAP: new issue has been created " + returnedIssue.getKey());
LogUtils.getGeneral().info("CreateRemoteIssue::execute: SOAP: new issue has been created project" + returnedIssue.getProject());
LogUtils.getGeneral().info("CreateRemoteIssue::execute: SOAP: new issue has been created priority" + returnedIssue.getPriority());

Unless I am missing something the plugin client code is doing the correct thing and should work ... and does for everything except the remote key.


Timothy Chin [Atlassian] - 23/Mar/08 08:52 PM
Hi Lance,

I will resolve this issue as 'Cannot Be Reproduce' for now and will continue to support you via a support request at JSP-21370. If this is confirmed as a bug and is reproducible, we will re-open this issue.

Regards,
Timothy