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

Assets object cannot be added to an Assets custom field with error "Could not find Assets object/s"

      Issue Summary

      Assets object cannot be added to an Assets custom field with error "Could not find Assets object/s". This seems to be affecting only when the Filter Issue Scope and/or Filter Assign Scope has AQL involving placeholder currentReporter().
      This is reproducible on Data Center: yes

      Steps to Reproduce

      This issue is not reproducible in 5.12.x.

      1. In 5.13.x or 5.14.0, create a Business project with sample data from Assets ITSM template. This creates a set of objects and users which makes the following reproducing steps easier.
      2. Create an Assets object custom field and add it to the all the screens of the new project.
      3. Configure the custom field to get objects from the new schema and below
        Filter Scope (AQL): objectType = Employees
        Filter Issue Scope (AQL): "JIRA User" = currentReporter()
        Filter Assign Scope (AQL): "JIRA User" = currentReporter()
        
      1. Ensure the Make Filter Assign Strict option is not selected.
      2. Create a new issue in the same project by filling in the Summary field and setting the Reporter to Fred Astair, leave all other fields as they are.
      3. The new Assets custom field (created in step 2) is not populated automatically. Edit the issue and click on this custom field to add the suggested object.

      Expected Results

      • When the issue is created, the Assets custom field should have the expected object automatically added.
      • When editing the custom field, the suggested object should be added successfully without error.

      Actual Results

      • Despite fulfilling the requirement on the Filter Assign Scope AQL, the object is not assigned automatically.
      • When attempting to add the object manually, the right object is found but it can't be added with error "Could not find Assets object/s (<object key>)" on the screen
      • As long as the AQL involving currentReporter() is in Filter Issue Scope and/or Filter Assign Scope, it's not possible to assign the object despite being suggested
      • The exception below involving the affected Assets custom field might be found in the atlassian-jira.log.
        2024-02-26 12:41:54,022+0200 http-nio-8080-exec-1 WARN admin 761x162732x1 1syme2s 10.10.10.22 /rest/insight_servicedesk/1.0/servicedesk/customfield/default/341/objects [c.r.j.p.i.services.cache.ObjectIdParser] Failed to parse object id from object key ${CUSTOMFIELD_12345.KEY}
        java.lang.NumberFormatException: For input string: "${CUSTOMFIELD_12345.KEY}"
        ...
        

      Workaround

      • If applicable, select the Make Filter Assign Strict option so that the automatic assignment of objects always happens (issue creation, edit).
      • With this bug, editing the field to add the object is impossible. For affected issues, trigger a field update on the issue like editing the summary, description or label change will make the object assignment happen, provided that the Make Filter Assign Strict option is selected.
      • Note: Removing the AQL from the Filter Issue Scope and/or Filter Assign Scope will allow the expected object(s) to be added manually but this means automatic assignment of objects will not happen. To ensure automatic assignment during issue creation, we can make use of the Assets post function, Assign Objects from an AQL query based on data from an issue. to auto assign the object to the Assets custom field. Add the AQL and specify the Assets custom field accordingly.

        Ensure that this post function is after the Issue Created event.

      Workaround2 :

      Please disable the Feature flag : assets.aql.scope.filtering.on.issue.update in your environment. For details of how to update feature flag refer this page.

      Note- With this feature flag added, the "Filter Issue scope" configuration on the asset custom field is not respected and you can type and select the Asset Objects from different Object Schema.

      Workaround 3 : 

      Explicitly mention the Object ID in a new text field on the screen where the custom field is present. 

        1. image-2024-02-26-12-20-47-672.png
          image-2024-02-26-12-20-47-672.png
          185 kB
        2. image-2024-02-26-12-29-27-960.png
          image-2024-02-26-12-29-27-960.png
          219 kB
        3. screenshot-1.png
          screenshot-1.png
          101 kB
        4. screenshot-2.png
          screenshot-2.png
          159 kB

            [JSDSERVER-15141] Assets object cannot be added to an Assets custom field with error "Could not find Assets object/s"

            Marc Dacanay made changes -
            Labels Original: backend ltsr New: backend
            Marc Dacanay made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 938761 ]
            Marc Dacanay made changes -
            Labels Original: backend New: backend ltsr
            Karan Ahuja made changes -
            Description Original: h3. Issue Summary

            Assets object cannot be added to an Assets custom field with error "Could not find Assets object/s". This seems to be affecting only when the Filter Issue Scope and/or Filter Assign Scope has AQL involving placeholder {*}currentReporter(){*}.
            This is reproducible on Data Center: yes
            h3. Steps to Reproduce

            (i) This issue is {*}not reproducible in 5.12.x{*}.
             # In 5.13.x or 5.14.0, create a Business project with sample data from Assets ITSM template. This creates a set of objects and users which makes the following reproducing steps easier.
             # Create an Assets object custom field and add it to the all the screens of the new project.
             # Configure the custom field to get objects from the new schema and below
            {code:java}
            Filter Scope (AQL): objectType = Employees
            Filter Issue Scope (AQL): "JIRA User" = currentReporter()
            Filter Assign Scope (AQL): "JIRA User" = currentReporter()
            {code}

             # Ensure the *Make Filter Assign Strict* option is not selected.
             # Create a new issue in the same project by filling in the Summary field and setting the Reporter to Fred Astair, leave all other fields as they are.
             # The new Assets custom field (created in step 2) is not populated automatically. Edit the issue and click on this custom field to add the suggested object.
            !image-2024-02-26-12-29-27-960.png|thumbnail!

            h3. Expected Results
             * When the issue is created, the Assets custom field should have the expected object automatically added.
             * When editing the custom field, the suggested object should be added successfully without error.

            h3. Actual Results
             * Despite fulfilling the requirement on the Filter Assign Scope AQL, the object is not assigned automatically.
             * When attempting to add the object manually, the right object is found but it can't be added with error "Could not find Assets object/s (<object key>)" on the screen
            !image-2024-02-26-12-20-47-672.png|thumbnail!
             * As long as the AQL involving currentReporter() is in Filter Issue Scope and/or Filter Assign Scope, it's not possible to assign the object despite being suggested
             * The exception below involving the affected Assets custom field might be found in the atlassian-jira.log.
            {code}
            2024-02-26 12:41:54,022+0200 http-nio-8080-exec-1 WARN admin 761x162732x1 1syme2s 10.10.10.22 /rest/insight_servicedesk/1.0/servicedesk/customfield/default/341/objects [c.r.j.p.i.services.cache.ObjectIdParser] Failed to parse object id from object key ${CUSTOMFIELD_12345.KEY}
            java.lang.NumberFormatException: For input string: "${CUSTOMFIELD_12345.KEY}"
            ...
            {code}

            h3. Workaround
             * If applicable, select the *Make Filter Assign Strict* option so that the automatic assignment of objects always happens (issue creation, edit).
             * With this bug, editing the field to add the object is impossible. For affected issues, trigger a field update on the issue like editing the summary, description or label change will make the object assignment happen, provided that the *Make Filter Assign Strict* option is selected.
             * Note: Removing the AQL from the Filter Issue Scope and/or Filter Assign Scope will allow the expected object(s) to be added manually but this means automatic assignment of objects will not happen. To ensure automatic assignment during issue creation, we can make use of the Assets post function, *Assign Objects from an AQL query based on data from an issue.* to auto assign the object to the Assets custom field. Add the AQL and specify the Assets custom field accordingly.
            !screenshot-2.png|thumbnail!
            (!) Ensure that this post function is after the Issue Created event.
            !screenshot-1.png|thumbnail!

            h3. Workaround2 :

            Please disable the Feature flag : *assets.aql.scope.filtering.on.issue.update* in your environment. For details of how to update feature flag refer [this|https://confluence.atlassian.com/jirakb/how-to-manage-dark-features-in-jira-959286331.html] page.

             
            h3. Workaround 3 : 

            Explicitly mention the Object ID in a new text field on the screen where the custom field is present. 
            New: h3. Issue Summary

            Assets object cannot be added to an Assets custom field with error "Could not find Assets object/s". This seems to be affecting only when the Filter Issue Scope and/or Filter Assign Scope has AQL involving placeholder {*}currentReporter(){*}.
            This is reproducible on Data Center: yes
            h3. Steps to Reproduce

            (i) This issue is {*}not reproducible in 5.12.x{*}.
             # In 5.13.x or 5.14.0, create a Business project with sample data from Assets ITSM template. This creates a set of objects and users which makes the following reproducing steps easier.
             # Create an Assets object custom field and add it to the all the screens of the new project.
             # Configure the custom field to get objects from the new schema and below
            {code:java}
            Filter Scope (AQL): objectType = Employees
            Filter Issue Scope (AQL): "JIRA User" = currentReporter()
            Filter Assign Scope (AQL): "JIRA User" = currentReporter()
            {code}

             # Ensure the *Make Filter Assign Strict* option is not selected.
             # Create a new issue in the same project by filling in the Summary field and setting the Reporter to Fred Astair, leave all other fields as they are.
             # The new Assets custom field (created in step 2) is not populated automatically. Edit the issue and click on this custom field to add the suggested object.
            !image-2024-02-26-12-29-27-960.png|thumbnail!

            h3. Expected Results
             * When the issue is created, the Assets custom field should have the expected object automatically added.
             * When editing the custom field, the suggested object should be added successfully without error.

            h3. Actual Results
             * Despite fulfilling the requirement on the Filter Assign Scope AQL, the object is not assigned automatically.
             * When attempting to add the object manually, the right object is found but it can't be added with error "Could not find Assets object/s (<object key>)" on the screen
            !image-2024-02-26-12-20-47-672.png|thumbnail!
             * As long as the AQL involving currentReporter() is in Filter Issue Scope and/or Filter Assign Scope, it's not possible to assign the object despite being suggested
             * The exception below involving the affected Assets custom field might be found in the atlassian-jira.log.
            {code:java}
            2024-02-26 12:41:54,022+0200 http-nio-8080-exec-1 WARN admin 761x162732x1 1syme2s 10.10.10.22 /rest/insight_servicedesk/1.0/servicedesk/customfield/default/341/objects [c.r.j.p.i.services.cache.ObjectIdParser] Failed to parse object id from object key ${CUSTOMFIELD_12345.KEY}
            java.lang.NumberFormatException: For input string: "${CUSTOMFIELD_12345.KEY}"
            ...
            {code}

            h3. Workaround
             * If applicable, select the *Make Filter Assign Strict* option so that the automatic assignment of objects always happens (issue creation, edit).
             * With this bug, editing the field to add the object is impossible. For affected issues, trigger a field update on the issue like editing the summary, description or label change will make the object assignment happen, provided that the *Make Filter Assign Strict* option is selected.
             * Note: Removing the AQL from the Filter Issue Scope and/or Filter Assign Scope will allow the expected object(s) to be added manually but this means automatic assignment of objects will not happen. To ensure automatic assignment during issue creation, we can make use of the Assets post function, *Assign Objects from an AQL query based on data from an issue.* to auto assign the object to the Assets custom field. Add the AQL and specify the Assets custom field accordingly.
            !screenshot-2.png|thumbnail!
            (!) Ensure that this post function is after the Issue Created event.
            !screenshot-1.png|thumbnail!

            h3. Workaround2 :

            Please disable the Feature flag : *assets.aql.scope.filtering.on.issue.update* in your environment. For details of how to update feature flag refer [this|https://confluence.atlassian.com/jirakb/how-to-manage-dark-features-in-jira-959286331.html] page.

            *Note-* _With this feature flag added, the "Filter Issue scope" configuration on the asset custom field is not respected and you can type and select the Asset Objects from different Object Schema._
            h3. Workaround 3 : 

            Explicitly mention the Object ID in a new text field on the screen where the custom field is present. 
            Michelle Chin made changes -
            Link New: This issue has a regression in JSDSERVER-15353 [ JSDSERVER-15353 ]

            ac2ec4681a01

            +1

            Only with the enabled feature flag, we are able to continue using Asset Object custom fields with placeholders!

            Brüse, Bernhard added a comment - ac2ec4681a01 +1 Only with the enabled feature flag, we are able to continue using Asset Object custom fields with placeholders!

            Jakub Talarczyk added a comment - - edited

            hi 3af59e58d8d3 thx for the tip, you are my hero of the day!

            And dear Atlassian, the problem is still not fixed in the version 5.16.1 / 5.17.0 - we just tested it on our test instance. Only the dark feature workaround worked.

            Could you please reopen the ticket?

            Regards

            Jakub

            Jakub Talarczyk added a comment - - edited hi 3af59e58d8d3 thx for the tip, you are my hero of the day! And dear Atlassian, the problem is still not fixed in the version 5.16.1 / 5.17.0 - we just tested it on our test instance. Only the dark feature workaround worked. Could you please reopen the ticket? Regards Jakub

            Adding assets.aql.scope.filtering.on.issue.update.disabled to Dark Features fixed this issue.

            Dark features:
            <BASE_URL>/secure/admin/SiteDarkFeatures!default.jspa

            Joni Smolander added a comment - Adding assets.aql.scope.filtering.on.issue.update.disabled to Dark Features fixed this issue. Dark features: <BASE_URL>/secure/admin/SiteDarkFeatures!default.jspa
            SET Analytics Bot made changes -
            UIS Original: 74 New: 90
            Satej Mirpagar made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Waiting for Release [ 12075 ] New: Closed [ 6 ]

              bfa5bb10b6a8 Arslan Qamar (Inactive)
              michin Michelle Chin
              Affected customers:
              13 This affects my team
              Watchers:
              26 Start watching this issue

                Created:
                Updated:
                Resolved: