New and Improved 3.13 Beta. Highlights: Shareable filters and dashboards and lots of other goodies. Any feedback can be raised as JIRA issues in the JIRA project.
Issue Details (XML | Word | Printable)

Key: JRA-10595
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dushan Hanuska [Atlassian]
Reporter: Yuen-Chi Lian [Atlassian]
Votes: 2
Watchers: 2
Operations

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

SOAPUtils's transformToStringArray() always returns an empty String array

Created: 12/Jul/06 04:26 AM   Updated: 04/Aug/06 07:35 AM
Component/s: Remote API (SOAP & XML-RPC)
Affects Version/s: None
Fix Version/s: 3.6.4

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

File Attachments: 1. GZip Archive com.atlassian.jira.rpc.soap.util.tar.gz (5 kB)

Issue Links:
Reference
 

Participants: Dushan Hanuska [Atlassian], Ted Pietrzak and Yuen-Chi Lian [Atlassian]
Since last comment: 2 years, 5 weeks ago
Resolution Date: 20/Jul/06 06:06 PM
Labels:


 Description  « Hide
This causes quite some troubles, like, in an XML-RPC response, a cascading select custom field will be in this structure,
<member>
  <name>customFieldValues</name>
 
  ...
    <value>
      <struct>
        <member>
          <name>customfieldId</name>
          <value>customfield_10100</value>
        </member>
      </struct>
    </value>

    <value>
      <struct>
        <member>
          <name>customfieldId</name>
          <value>customfield_10100</value>
        </member>

        <member>
          <name>key</name>
          <value>1</value>
        </member>
      </struct>
    </value>

  ...
</member>

which holds meaningless information.

This affects both SOAP and XML-RPC services.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Yuen-Chi Lian [Atlassian] added a comment - 12/Jul/06 04:41 AM
Here's the code of the function:
private static String[] transformToStringArray(Collection values, CustomFieldType customFieldType)
    {
        String[] returnValues = new String[values.size()];

        int i = 0;
        for (Iterator iterator = values.iterator(); iterator.hasNext();)
        {
            Object singularObject = iterator.next();
            returnValues[i] = customFieldType.getStringFromSingularObject(singularObject);
            i++;
        }

        return new String[0];
    }

It should return returnValues, and to also have a catch block to return new String[0].

The fix will produce this result as compared to the snippet in the Description above:

<member>
  <name>customFieldValues</name>
 
  ...
<value>
  <struct>
    <member>
      <name>values</name>
      <value>10195</value>
    </member>
    <member>
      <name>customfieldId</name>
      <value>customfield_10100</value>
    </member>
  </struct>
</value>

<value>
  <struct>
    <member>
      <name>values</name>
      <value>10197</value>
    </member>

    <member>
      <name>customfieldId</name>
      <value>customfield_10100</value>
    </member>

    <member>
      <name>key</name>
      <value>1</value>
    </member>
  </struct>
</value>

  ...
</member>


Cheers,
Yuen-Chi Lian

"I do not seek. I find." - Pablo Picasso


Yuen-Chi Lian [Atlassian] added a comment - 18/Jul/06 06:16 PM
Attached Java class and source.

Cheers,
Yuen-Chi


Ted Pietrzak added a comment - 20/Jul/06 09:49 AM
Yuen-Chi,
Are we meant to use the attachment as a patch?

Ted


Ted Pietrzak added a comment - 24/Jul/06 10:54 AM
How do we apply the patch?

Ted


Yuen-Chi Lian [Atlassian] added a comment - 24/Jul/06 10:53 PM
Hi Ted,

Dushan has fixed and published it: http://repository.atlassian.com/atlassian-jira-rpc-plugin/jars/atlassian-jira-rpc-plugin-3.6.3-2.jar (;

Please refer to the JIRA RPC Plugin Confluence space for more information.


Cheers,
Yuen-Chi Lian

"I do not seek. I find." - Pablo Picasso