Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-7376

Insight JAVA API method getObjectAttributeBeans() does not return Attribute beans of the type textarea when loading the object from custom field

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 4.16.0

      Issue Summary

      When accessing an Insight object loaded from a custom field via the Java api, the method getObjectAttributeBeans() does not return Attribute beans of the type text area.

      Steps to Reproduce

      1. Create a new custom field of any insight type.
      2. Fill it with an object that has a text area attribute.
      3. Then get the value as a (mutable) objectbean with Insight JAVA API:
        ex:
        ((issue.getCustomFieldValue(customFieldManager.getCustomFieldObject(10145)) as List<*>).firstOrNull() as MutableObjectBean)
        

      Expected Results

      This objectBean should include all attributes.

      Actual Results

      This objectBean will not include all attributes.

      Workaround

      As clarified by Insight devs this happen because textarea attribute is not set on indexed when newly created.

      To workaround the issue edit the settings for the attribute textarea and flag it as indexed:

            [JSDSERVER-7376] Insight JAVA API method getObjectAttributeBeans() does not return Attribute beans of the type textarea when loading the object from custom field

            Marc Dacanay made changes -
            Labels New: ril
            Marc Dacanay made changes -
            Remote Link New: This issue links to "Internal ticket (Web Link)" [ 955274 ]

            Heiko Treuner added a comment - - edited

            Hello,

            i have an better worakaround for the Programmer's because how did u wil evaluate that all Textarea fields are set the index checkbox? 

            First the story for my WA i'm an Programmer and the first thing that i read is not the User doc its the java doc wich i read first and playing with it. To get the Attr. i was using for the first time the same way as the reporter and get the same Bug. (get field value and the Attributes of it) I was wondering why this happens and the first in my mind was ok there is an Manager Class that could be used to specialy load the object by an Id and tada the second workaround was born. If u load the Object bean by the manager class the bug not happens.  

            //LOAD the Object by the Manager Class and get then the Object Attributes to prevent the Bug
            objectFacade.loadObjectBean(insightField.getAt(0).getId()).getObjectAttributeBeans().each{         
             it.getObjectAttributeValueBeans().each{    
               log.error(it.getValue());  
             }
            }
            
            //instead of load the Object Attributes from the Field Value 
            insightField.getAt(0).getObjectAttributeBeans().each {   
             it.getObjectAttributeValueBeans().each {     
              log.error(it.getValue());  
             }
            }
            
            

            Cheers,

            Heiko

            Heiko Treuner added a comment - - edited Hello, i have an better worakaround for the Programmer's because how did u wil evaluate that all Textarea fields are set the index checkbox?  First the story for my WA i'm an Programmer and the first thing that i read is not the User doc its the java doc wich i read first and playing with it. To get the Attr. i was using for the first time the same way as the reporter and get the same Bug. (get field value and the Attributes of it) I was wondering why this happens and the first in my mind was ok there is an Manager Class that could be used to specialy load the object by an Id and tada the second workaround was born. If u load the Object bean by the manager class the bug not happens.   //LOAD the Object by the Manager Class and get then the Object Attributes to prevent the Bug objectFacade.loadObjectBean(insightField.getAt(0).getId()).getObjectAttributeBeans().each{ it.getObjectAttributeValueBeans().each{ log.error(it.getValue()); } } //instead of load the Object Attributes from the Field Value insightField.getAt(0).getObjectAttributeBeans().each { it.getObjectAttributeValueBeans().each { log.error(it.getValue()); } } Cheers, Heiko
            Kunal Kanojia made changes -
            Status Original: Needs Triage [ 10030 ] New: Gathering Impact [ 12072 ]
            Bugfix Automation Bot made changes -
            Support reference count New: 1
            Tiziana Marchionni made changes -
            Summary Original: Insight JAVA API method getObjectAttributeBeans() does not return Attribute beans of the type text area when loading the object from custom field New: Insight JAVA API method getObjectAttributeBeans() does not return Attribute beans of the type textarea when loading the object from custom field
            Tiziana Marchionni created issue -

              Unassigned Unassigned
              tmarchionni@atlassian.com Tiziana Marchionni
              Affected customers:
              1 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated: