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

Behaviour setFormValue() doesn't set the Insight fields when logging in as a user that is not in any group, while the Object Schema Users permissions for JSM Customers are enabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Triage
    • Low
    • Resolution: Unresolved
    • 6.50.0
    • None
    • Behaviours
    • None
    • SR4J Sprint 133 (7.03)
    • 10.4

    Description

      Summary

      Set the Insight Object/s field value using Behaviours setFormValue() doesn't work when a user/customer has not been added to any group, but the Object Schema Users permissions for Jira Service Management Customers are ENABLED.

      Steps to Reproduce

      Prerequisites

      Insight - Asset Management

      • Install Insight - Asset Management
      • Create an Object Schema
      • Create some objects in the created Object Schema
      • Configure that created Object Schema, select the "Roles" tab, and enable the Object Schema Users permissions for Jira Service Management Customers:

        This configuration automatically grants all Jira Service Desk customers permission to view (but not edit or modify) objects in an object schema.

       

      User Management

      Create a new user, e.g. carmen, untick the following on the Application access section:

      • Jira Service Management (includes Jira Core)
      • Jira Software (includes Jira Core)
      • Jira Core

      1. Create an Insight Object/s field. Configure this Insight field to select the created schema.
      2. Associate the Insight Object/s field with the Service Desk projects, e.g. IT Desk project.
      3. Create a Behaviour, add Service Desk mapping to the IT Desk project and all request types.
      4. Attach the following snippet to the Behaviour Initialiser:

      //Change the "Insight Objects" to your Insight Object/s field name and "HOS-1" to the object keys
      getFieldByName("Insight Objects").setFormValue("HOS-1")
      

      5. Navigate to the IT Desk project and add the Insight Object/s field to the request types.

      6. Navigate to the IT Desk portal and login as "admin" user. Select a request type and the request form will show the Insight Object/s field value is set with an object.

      7. Navigate to the IT Desk portal, log in as the newly created user, e.g. carmen, then select a request type. 

      Expected Behaviour

      When the Object Schema Users permissions for Jira Service Management Customers are ENABLED, the Behaviour should set the Insight Object/s field value, and the field shows the object "HOS-1" value.

      Actual Behaviour

      When the Object Schema Users permissions for Jira Service Management Customers are ENABLED, the Behaviour is triggered, but the Insight Object/s field is not set and returns a null value. 

      Additional Info

      1) Tested on Jira 8.20.7, ScriptRunner 6.52.1 (latest version). 

      2) Attached is a screenshot and a HAR file when login as an "admin" user:
      userWithPermission.har

      3) Attached is a screenshot and a HAR file when login as a user/customer, e.g. carmen, that is not added to any group:
      userWithoutPermission.har

      4) Tested on Jira 8.22.6, ScriptRunner 7.4.0 (current latest version).
      The setting of field value only works for the licensed user via server-side script but not initialiser.

      Example: 2 Insight Object/s fields named Field A and Field B

      Server-side script on Field A:

      def insightObjA = getFieldById(getFieldChanged())
      def insightObjB = getFieldById("customfield_XXXXX")
      
      if (insightObjA.value == "ABC-1") {          
      
          insightObjB.setFormValue("ABC-4")
      
      }
      

      Attachments

        1. configure pbject schema roles.png
          configure pbject schema roles.png
          199 kB
        2. user management.png
          user management.png
          168 kB
        3. userWithoutPermission.har
          208 kB
        4. userWithoutPermission.png
          userWithoutPermission.png
          425 kB
        5. userWithPermission.har
          262 kB
        6. userWithPermission.png
          userWithPermission.png
          460 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jpang JJ Pang
              Votes:
              6 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated: