Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-5329

Behaviours' getValue outputs null on Insight Object/s field

    XMLWordPrintableJSON

    Details

    • Sprint:
      SR4J Sprint 105, SR4J Sprint 106
    • Critical Points:
      6.4

      Description

      Summary

      The value of an Insight Object/s field output as null (in SR 6.25.0 - 6.31.0) instead of the selected object's key (in SR 6.24.0). This causes our customer's existing Behaviour scripts to stop working.

      Steps to Reproduce the Problem

      Prerequisites

      • Install Insight - Asset Management 8.7.6
      • Configure Insight Object Schema
        Steps
        1. Click on the Insight tab on the top ribbon > Select Insight Object Schemas
        2. Click on Create an Object Schema > Select 'Create Sample IT Asset Schema' > Next
        3. Simply Input 'IT Asset Schema' as Name & leave the auto-populated Key field value be > Create
        4. On the Insight Object Schemas list page, click on the IT Asset Schema created
        5. On the thin vertical panel, click on the 'Expand all' button to expand the Object types & Objects tree
        6. You'll see the nested elements under the 'Network Assets' object type. Click on 'Connected Device'
        7. With 'Connected Device' selected, click on the hyperlinked 'create an object' text displayed in the middle of the screen. A 'Create Object' screen will pop up
        8. Simply input 'Laptop 1' in the Name field & 'L00001' in the Device ID field. Check the 'Create another' box > Create
        9. Repeat step 8 twice with 'Laptop 2' & 'Laptop 3' for the Name & 'L00002' & 'L00003' for the Device ID field, respectively
        10. Note that each object has its own unique key i.e. IAS-1, IAS-2, IAS-3.

      1. Add an Insight Object/s custom field > Select a sample project > Create > Associate it to the project's default issue screen > Update
      2. On the custom fields page, click on the created Insight Object/s field's cogwheel button > Click Configure
      3. Click 'Edit Insight Configuration'. For these settings:

      Object Schema: Click on the 'Not configured' text next to it & select 'IT Asset Schema'.
      Filter objects with attributes: Click on the downward arrow > Choose 'Device ID' & remove the existing 'Label' attribute
      Object attributes on Issue view: Click on the downward arrow > Choose 'Device ID'
      Multiple: Check the box

      4. Create Behaviour > map it to applicable project & issue types > Add the following as Initialiser and server-side script on the Insight Object/s field

      def insightObjField = getFieldById("customfield_10200") //change the ID to your own value
      log.warn("Insight Object/s field value: " + insightObjField.getValue())
      

      5. Click on Create issue button & observe the logs
      The entry in the logs should read
      SR 6.25.0 - 6.27.0

      ---load Create issue screen---
      Insight Object/s field value: null
      

      SR 6.24.0

      Insight Object/s field value:
      

      6. Select an object on the Insight Object/s field e.g. L00001
      The entry in the logs should now read

      SR 6.25.0 - 6.27.0

      ---select insight object---
      Insight Object/s field value: IAS-1
      

      SR 6.24.0

      Insight Object/s field value: IAS-1
      

      7. Change the Issue Type OR create the issue and navigate to the Edit Screen. Note that the output is null although the selected object remains on the field
      The entry in the logs
      SR 6.25.0 - 6.27.0

      ---switch issue type---
      Insight Object/s field value: null
      

      SR 6.24.0

      Insight Object/s field value: IAS-1
      

      Expected Behaviour

      The output of the Insight Object/s field is the selected object's key value.

      Actual Behaviour

      The output of the Insight Object/s field is null.

      Additional Info

      • Reproduced in
        Jira Software 8.5.4 | Insight - Asset Management 8.7.6 | ScriptRunner 6.24.0 (works correctly on this version)
        Jira Software 8.5.4 | Insight - Asset Management 8.7.6 | ScriptRunner 6.25.0
        Jira Software 8.5.4 | Insight - Asset Management 8.7.6 | ScriptRunner 6.26.0
        Jira Software 8.5.4 | Insight - Asset Management 8.7.6 | ScriptRunner 6.27.0
        Jira Software 8.14.0 | Insight - Asset Management 8.7.6 | ScriptRunner 6.27.0
        Jira Software 8.14.0 | Insight - Asset Management 8.7.10 | ScriptRunner 6.27.0
        Jira Software 8.16.2 | Insight - Asset Management 8.7.12 | ScriptRunner 6.30.2 and 6.31.0
      • atlassian-jira.log (filtered out & organized according to SR versions tested) - click here & look only at the Server-side script section.

        Attachments

          Activity

            People

            Assignee:
            dluksza Dariusz Luksza
            Reporter:
            wkoh Winnie Koh
            Votes:
            5 Vote for this issue
            Watchers:
            19 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: