title: Method return wrong type of value in Groovy
body: <p>I'm working on a groovy method to look for a custom attribute and return the value if the key is found.<br />
  The problem is that the method is returning the type of value instead of the value.</p>
  <pre><code>    // There is more code before, but its not involved with this issue.
  
      def UUIDca = 'UUID'
      String customAttributeValue = grabCustomAttribute(UUIDca, event_work)
      appendLogfile(&quot;\n\nTest grabCustomAttribute: ${customAttributeValue}\n&quot;)  
    }
  
    // Grab the Custom Message Attribute values by name
    String grabCustomAttribute (String findElement, OprEvent event){
  
      appendLogfile(&quot;&quot;&quot;\nIN grabCustomAttribute\nElement to look: ${findElement}\n&quot;&quot;&quot;)
  
      def firstItem = true
      if (event.customAttributes?.customAttributes?.size()) {
        event.customAttributes.customAttributes.each { ca -&gt;
          // Define each CMA to catch here
  
          appendLogfile(&quot;&quot;&quot;\nElement: ${ca.name} - &quot;&quot;&quot;)
          appendLogfile(&quot;&quot;&quot;Valor: ${ca.value}\n&quot;&quot;&quot;)
  
          if (&quot;${ca.name}&quot; == findElement) {
            String customValue = ca.value
  
            appendLogfile(&quot;&quot;&quot;Custom Attribute Found\n&quot;&quot;&quot;)
            appendLogfile(customValue)
  
            return customValue
          }
        }
      }
    }
  </code></pre>
  <p>appendLogfile is basically a print to a log file :)<br />
  This is the output I'm getting.</p>
  <blockquote>
  <p>IN grabCustomAttribute Element to look: UUID</p>
  <p>Element: UUID - Valor: c3bb9169-0ca3-4bcf-beb1-f94eda8ebf1a<br />
  Custom Attribute Found<br />
  c3bb9169-0ca3-4bcf-beb1-f94eda8ebf1a</p>
  <p>Test grabCustomAttribute: [com.hp.opr.api.ws.model.event.OprCustomAttribute@940e503a]</p>
  </blockquote>
  <p>Instead of returning the value, it returns the type of object. It's correct, but I'm looking for the value.<br />
  I believe the solution is really simple, but I'm very new to Groovy.</p>
  <p>Any help will be appreciated.
  Thanks.</p>