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

Assets Customfields with Filter Assign Scope should update the field in the background

      Issue Summary

      When a custom field with the "Make filter assign strict" option selected is added to an issue, whenever the assignee/reporter is changed, the custom field takes up to 30 seconds to update, but the screen stays held while waiting for the update.

      Assets Customfields with Filter Assign Scope should update the field in the background, as currently it's performed in the foreground, causing slowness every time the reporter/assignee is changed.

      This is reproducible on the Data Center: yes

      Steps to Reproduce

      1. Configure an Assets custom field referencing an object type that has a user attribute (see the screenshot below).
      2. Set this field with the Filter Assign Scope. The filter uses the reporter smart value as the reference
      3. Whenever the reporter is changed and Jira has many users, the field takes too long to update. This update is performed in the foreground, holding the page refresh for 30 seconds. This field update shouldn't be holding the page refresh.

      Expected Results

      The page refresh shouldn't wait for the field update and hold the screen.

      Actual Results

      Nothing is added to the logs, as this is not an error, but the screen keeps waiting for the field update.

      Workaround

      The workaround is to setup an automation to update the field in backgrouns intead of checking the Filter Assign Scope attribute in the field configuration:

      1 - Create an Automation Rule that triggers when an issue is created or edited.

      2 - Create a "Send Web Request" action to get the ObjectID from Assets related to the reporter user:

      2.1 - You have to create a secret to authenticate in Jira API, you can generate from the command line:

      echo -n "user:password" | base64
      

      Replace with your username and password. You can add it directly in the automation header field or add using a Jira Automation secret.

      2.2 - Action configuration:

      Webhook URL (replace your Jira Base URL):

      https://<JIRA-BASE-URL>/rest/assets/1.0/aql/objects?qlQuery=%22Jira%20User%22%20=%20%22\{{reporter.displayName.urlEncode}}%22
      

      Headers:

      • Authorization: Basic <BASE64-AUTH-OR-SECRET>
      • Content-Type: application/json

      Type: GET

      Mark the "Wait for response: Delay execution of subsequent rule actions until we've received a response for this webhook"

      3 - Then add the Edit issue action, do not choose any field and on "More options" use this in the "Additional fields":

      {
          "update" : {
              "customfield_10518" : [{"set": [{"key" : "{{webhookResponse.body.objectEntries.get(0).objectKey}}"}]}]
          }
      }
      

            [JSDSERVER-15499] Assets Customfields with Filter Assign Scope should update the field in the background

            Benjamin Suess made changes -
            Status Original: Short Term Backlog [ 12074 ] New: Gathering Impact [ 12072 ]
            Benjamin Suess made changes -
            Status Original: Gathering Impact [ 12072 ] New: Short Term Backlog [ 12074 ]
            Marc Dacanay made changes -
            Labels Original: LTS10x-Marked New: LTS10x-Marked ril
            Marc Dacanay made changes -
            Remote Link New: This issue links to "Internal ticket (Web Link)" [ 956112 ]
            Marc Dacanay made changes -
            Status Original: Needs Triage [ 10030 ] New: Gathering Impact [ 12072 ]
            Binoy Nicholas made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 937219 ]
            Binoy Nicholas made changes -
            Labels New: LTS10x-Marked
            SET Analytics Bot made changes -
            Support reference count New: 1
            Hugo Fernandes made changes -
            Summary Original: Assets Customfields with Filter Assign Scope should update the field in background New: Assets Customfields with Filter Assign Scope should update the field in the background
            Hugo Fernandes made changes -
            Description Original: h3. Issue Summary

            Assets Customfields with Filter Assign Scope should update the field in background, as currently it's performed in the foreground causing slowness every time the reporter/asignee is changed.

            {*}This is reproducible on the Data Center{*}: yes
            h3. Steps to Reproduce
             # Configure an Assets custom field referencing an object type that has a user attribute (see the screenshot below).
             # Set this field with the Filter Assign Scope. The filter uses the reporter smart value as the reference
             # Whenever the reporter is changed and Jira has many users, the field takes too long to update. This update is performed in the foreground, holding the page refresh for 30 seconds. This field update shouldn't be holding the page refresh.

            !image-2024-08-12-18-11-26-656.png|width=400!
            h3. Expected Results

            The page refresh shouldn't wait for the field update and hold the screen.
            h3. Actual Results

            Nothing is added to the logs, as this is not an error, but the screen keeps waiting for the field update.
            h3. Workaround

            The workaround is to setup an automation to update the field in backgrouns intead of checking the Filter Assign Scope attribute in the field configuration:

            *1 -* Create an Automation Rule that triggers when an issue is created or edited.

            *2 -* Create a "Send Web Request" action to get the ObjectID from Assets related to the reporter user:

            *2.1 -* You have to create a secret to authenticate in Jira API, you can generate from the command line:
            {code:java}
            echo -n "user:password" | base64
            {code}
            Replace with your username and password. You can add it directly in the automation header field or add using a Jira Automation secret.
             * [Create and edit masked secret keys for automation rules|https://confluence.atlassian.com/automation/create-and-edit-masked-secret-keys-for-automation-rules-1283362517.html].

            *2.2 -* Action configuration:
            {quote}*Webhook URL* (replace your Jira Base URL):
            {code:java}
            https://&lt;JIRA-BASE-URL&gt;/rest/assets/1.0/aql/objects?qlQuery=%22Jira%20User%22%20=%20%22\{{reporter.displayName.urlEncode}}%22
            {code}
            {*}Headers{*}:
             * Authorization: Basic <BASE64-AUTH-OR-SECRET>
             * Content-Type: application/json

            {*}Type{*}: GET

            (i) Mark the "Wait for response: Delay execution of subsequent rule actions until we've received a response for this webhook"
            {quote}
            *3 -* Then add the Edit issue action, do not choose any field and on "More options" use this in the "Additional fields":
            {code:java}
            {
                "update" : {
                    "customfield_10518" : [{"set": [{"key" : "{{webhookResponse.body.objectEntries.get(0).objectKey}}"}]}]
                }
            }
            {code}
            New: h3. Issue Summary

            When a custom field with the "Make filter assign strict" option selected is added to an issue, whenever the assignee/reporter is changed, the custom field takes up to 30 seconds to update, but the screen stays held while waiting for the update.

            Assets Customfields with Filter Assign Scope should update the field in the background, as currently it's performed in the foreground, causing slowness every time the reporter/assignee is changed.

            {*}This is reproducible on the Data Center{*}: yes
            h3. Steps to Reproduce
             # Configure an Assets custom field referencing an object type that has a user attribute (see the screenshot below).
             # Set this field with the Filter Assign Scope. The filter uses the reporter smart value as the reference
             # Whenever the reporter is changed and Jira has many users, the field takes too long to update. This update is performed in the foreground, holding the page refresh for 30 seconds. This field update shouldn't be holding the page refresh.

            !image-2024-08-12-18-11-26-656.png|width=400!
            h3. Expected Results

            The page refresh shouldn't wait for the field update and hold the screen.
            h3. Actual Results

            Nothing is added to the logs, as this is not an error, but the screen keeps waiting for the field update.
            h3. Workaround

            The workaround is to setup an automation to update the field in backgrouns intead of checking the Filter Assign Scope attribute in the field configuration:

            *1 -* Create an Automation Rule that triggers when an issue is created or edited.

            *2 -* Create a "Send Web Request" action to get the ObjectID from Assets related to the reporter user:

            *2.1 -* You have to create a secret to authenticate in Jira API, you can generate from the command line:
            {code:java}
            echo -n "user:password" | base64
            {code}
            Replace with your username and password. You can add it directly in the automation header field or add using a Jira Automation secret.
             * [Create and edit masked secret keys for automation rules|https://confluence.atlassian.com/automation/create-and-edit-masked-secret-keys-for-automation-rules-1283362517.html].

            *2.2 -* Action configuration:
            {quote}*Webhook URL* (replace your Jira Base URL):
            {code:java}
            https://&lt;JIRA-BASE-URL&gt;/rest/assets/1.0/aql/objects?qlQuery=%22Jira%20User%22%20=%20%22\{{reporter.displayName.urlEncode}}%22
            {code}
            {*}Headers{*}:
             * Authorization: Basic <BASE64-AUTH-OR-SECRET>
             * Content-Type: application/json

            {*}Type{*}: GET

            (i) Mark the "Wait for response: Delay execution of subsequent rule actions until we've received a response for this webhook"
            {quote}
            *3 -* Then add the Edit issue action, do not choose any field and on "More options" use this in the "Additional fields":
            {code:java}
            {
                "update" : {
                    "customfield_10518" : [{"set": [{"key" : "{{webhookResponse.body.objectEntries.get(0).objectKey}}"}]}]
                }
            }
            {code}
            Hugo Fernandes created issue -

              Unassigned Unassigned
              7e87200788f9 Hugo Fernandes
              Affected customers:
              0 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated: