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

Assets Automation - Action: Attribute value fails when automation rule triggers on "Object Moved"

      Issue Summary

      Assets Automation can trigger on an "Object Moved" event.

      If the Attribute Value Action is executed in the automation rule - it will attempt to update the Attribute (noted by the Attribute name!) of the source object type (pre-move) - which, of course, is no longer valid.

      It should look for the new object type attribute ID and update the moved object in its target object type.

      This issue may have been hidden there since the Action: Attribute value was first introduce (Insight 6.2), as the action is attempting to update the object in context (triggering) - but since its been moved, the Attribute Id has changed according to the target object type attribute Id...

      Steps to Reproduce

      1. Create an object type "Source", with a text attribute "Pre Automation text", note this Attribute's ID (see the Attributes tab, in the example below - 178)
      2. Create an object here, and leave "Automation text" empty.
      3. Copy this object type to a new Object type called "Target"
      4. In the Attributes tab, note the ID of the "Automation text" attribute at Target's Attributes tab (for this example - 189)
      5. Set up an automation rule on your current schema:
        WHEN: Object Moved
        IF: Any object (no AQL)
        THEN: Attribute Value: set "Automation text" with the value "updated in Automation"
      6. Move the object you have created in step2 to the Target object type, map all attributes 1:1

      Expected Results

      The object is moved to its Target OT, and the attribute "Automation text" shows the value: "updated in Automation"

      Actual Results

      the Attribute "updated in Automation" is still empty.

      2024-10-24 15:55:48,355 [insight-event-2] | Got rule and event for insightObjectAsyncEvent: null, id: 7 - InsightObjectEvent eventType: OBJECT_MOVED, rule id: 4, name: Move objects, isActive true, objectRuleEvent id: 7 and object: Public Website (ITSMITSM-5)2024-10-24 15:55:48,356 [insight-event-2] | doAction(), called for event class: InsightObjectMovedEvent2024-10-24 15:55:48,356 [insight-event-2] | Object name: Public Website, id: 52024-10-24 15:55:48,356 [insight-event-2] | Execute Rule action (AutomationAttributeValueAction): Start, id: 7, event [id: 7, aql: No aql], condition: None2024-10-24 15:55:48,356 [insight-event-2] | AutomationAttributeValueAction, data:  {"attributeName":"Status","value":"Incident in progress"}
      2024-10-24 15:55:48,357 [insight-event-2] | AutomationAttributeValueAction, got attributeName: Status, value: Incident in progress2024-10-24 15:55:48,360 [insight-event-2] | Error when updating object: Public Website (ITSMITSM-5) - objectTypeAttributeId: Object Type Attribute not valid (id: 178);

      Workaround

      Use a Groovy Script action to update the object accordingly, once it was moved. The Object's Key and object Id will remain unchanged post move.

      Versions Tested

      Please confirm all versions that have been tested for this issue, and indicate whether the tested version is affected or not affected, below: 

      Testing Requirements Version Affected Version
      Customers Reported Version Any (Yes)
      Most Recent Bug-Fix Release    
      Previous Major Release    
      Most Recent LTS    
      Previous Supported LTS    
      Other Versions..    
      (Add rows as needed)    

       

            [JSDSERVER-15639] Assets Automation - Action: Attribute value fails when automation rule triggers on "Object Moved"

            Satej Mirpagar made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Waiting for Release [ 12075 ] New: Closed [ 6 ]
            Yann made changes -
            Fix Version/s New: 10.5.0 [ 110315 ]
            Fix Version/s New: 10.4.1 [ 110415 ]
            Yann made changes -
            Status Original: In Review [ 10051 ] New: Waiting for Release [ 12075 ]
            Yann made changes -
            Assignee New: Yann [ a64d184ae8e6 ]
            Yann made changes -
            Status Original: In Progress [ 3 ] New: In Review [ 10051 ]
            Yann made changes -
            Status Original: Short Term Backlog [ 12074 ] New: In Progress [ 3 ]
            Bartosz Ornatowski made changes -
            Status Original: Needs Triage [ 10030 ] New: Short Term Backlog [ 12074 ]
            Security Metrics Bot made changes -
            Labels New: ril
            Security Metrics Bot made changes -
            Remote Link New: This issue links to "Internal ticket (Web Link)" [ 959385 ]
            Yinon Negev made changes -
            Description Original: h3. Issue Summary

            Assets Automation can trigger on an "Object Moved" event.

            If the Attribute Value Action is executed in the automation rule - it will attempt to update the Attribute (noted by the Attribute name!) of the source object type (pre-move) - which, of course, is no longer valid.

            It should look for the *new* object type attribute ID and update the *moved* object in its target object type.

            This issue may have been hidden there since the Action: Attribute value was first introduce ([Insight 6.2|https://confluence.atlassian.com/assetapps/insight-6-2-release-notes-1168847706.html]), as the action is attempting to update the object in context (triggering) - but since its been moved, the Attribute Id has changed according to the target object type attribute Id...
            h3. Steps to Reproduce
             # Create an object type "Source", with a text attribute "Pre Automation text", note this Attribute's ID (see the Attributes tab, in the example below - 178)
             # Create an object here, and leave "Automation text" empty.
             # Copy this object type to a new Object type called "Target"
             # In the Attributes tab, note the ID of the "Automation text" attribute at Target's Attributes tab (for this example - 189)
             # Set up an automation rule on your current schema:
            WHEN: Object Moved
            IF: Any object (no AQL)
            THEN: Attribute Value: set "Automation text" with the value "updated in Automation"
             # Move the object you have created in step2 to the Target object type, map all attributes 1:1

            h3. Expected Results

            The object is moved to its Target OT, and the attribute "Automation text" shows the value: "updated in Automation"
            h3. Actual Results

            the Attribute "updated in Automation" is still empty.
            {noformat}
            2024-10-24 15:55:48,355 [insight-event-2] | Got rule and event for insightObjectAsyncEvent: null, id: 7 - InsightObjectEvent eventType: OBJECT_MOVED, rule id: 4, name: Move objects, isActive true, objectRuleEvent id: 7 and object: Public Website (ITSMITSM-5)2024-10-24 15:55:48,356 [insight-event-2] | doAction(), called for event class: InsightObjectMovedEvent2024-10-24 15:55:48,356 [insight-event-2] | Object name: Public Website, id: 52024-10-24 15:55:48,356 [insight-event-2] | Execute Rule action (AutomationAttributeValueAction): Start, id: 7, event [id: 7, aql: No aql], condition: None2024-10-24 15:55:48,356 [insight-event-2] | AutomationAttributeValueAction, data: {"attributeName":"Status","value":"Incident in progress"}2024-10-24 {noformat}
            {noformat}
            15:55:48,357 [insight-event-2] | AutomationAttributeValueAction, got attributeName: Status, value: Incident in progress2024-10-24 15:55:48,360 [insight-event-2] | Error when updating object: Public Website (ITSMITSM-5) - objectTypeAttributeId: Object Type Attribute not valid (id: 178);{noformat}
            h3. Workaround

            Use a Groovy Script action to update the object accordingly, once it was moved. The Object's Key and object Id will remain unchanged post move.
            h3. Versions Tested

            Please confirm all versions that have been tested for this issue, and indicate whether the tested version is affected or not affected, below: 
            ||Testing Requirements||Version||Affected Version||
            |Customers Reported Version|_Any_|_(Yes)_|
            |Most Recent Bug-Fix Release| | |
            |Previous Major Release| | |
            |Most Recent LTS| | |
            |Previous Supported LTS| | |
            |_Other Versions.._| | |
            |_(Add rows as needed)_| | |

             
            New: h3. Issue Summary

            Assets Automation can trigger on an "Object Moved" event.

            If the Attribute Value Action is executed in the automation rule - it will attempt to update the Attribute (noted by the Attribute name!) of the source object type (pre-move) - which, of course, is no longer valid.

            It should look for the *new* object type attribute ID and update the *moved* object in its target object type.

            This issue may have been hidden there since the Action: Attribute value was first introduce ([Insight 6.2|https://confluence.atlassian.com/assetapps/insight-6-2-release-notes-1168847706.html]), as the action is attempting to update the object in context (triggering) - but since its been moved, the Attribute Id has changed according to the target object type attribute Id...
            h3. Steps to Reproduce
             # Create an object type "Source", with a text attribute "Pre Automation text", note this Attribute's ID (see the Attributes tab, in the example below - 178)
             # Create an object here, and leave "Automation text" empty.
             # Copy this object type to a new Object type called "Target"
             # In the Attributes tab, note the ID of the "Automation text" attribute at Target's Attributes tab (for this example - 189)
             # Set up an automation rule on your current schema:
            WHEN: Object Moved
            IF: Any object (no AQL)
            THEN: Attribute Value: set "Automation text" with the value "updated in Automation"
             # Move the object you have created in step2 to the Target object type, map all attributes 1:1

            h3. Expected Results

            The object is moved to its Target OT, and the attribute "Automation text" shows the value: "updated in Automation"
            h3. Actual Results

            the Attribute "updated in Automation" is still empty.
            {noformat}
            2024-10-24 15:55:48,355 [insight-event-2] | Got rule and event for insightObjectAsyncEvent: null, id: 7 - InsightObjectEvent eventType: OBJECT_MOVED, rule id: 4, name: Move objects, isActive true, objectRuleEvent id: 7 and object: Public Website (ITSMITSM-5)2024-10-24 15:55:48,356 [insight-event-2] | doAction(), called for event class: InsightObjectMovedEvent2024-10-24 15:55:48,356 [insight-event-2] | Object name: Public Website, id: 52024-10-24 15:55:48,356 [insight-event-2] | Execute Rule action (AutomationAttributeValueAction): Start, id: 7, event [id: 7, aql: No aql], condition: None2024-10-24 15:55:48,356 [insight-event-2] | AutomationAttributeValueAction, data: {"attributeName":"Status","value":"Incident in progress"}{noformat}
            {noformat}
            2024-10-24 15:55:48,357 [insight-event-2] | AutomationAttributeValueAction, got attributeName: Status, value: Incident in progress2024-10-24 15:55:48,360 [insight-event-2] | Error when updating object: Public Website (ITSMITSM-5) - objectTypeAttributeId: Object Type Attribute not valid (id: 178);{noformat}
            h3. Workaround

            Use a Groovy Script action to update the object accordingly, once it was moved. The Object's Key and object Id will remain unchanged post move.
            h3. Versions Tested

            Please confirm all versions that have been tested for this issue, and indicate whether the tested version is affected or not affected, below: 
            ||Testing Requirements||Version||Affected Version||
            |Customers Reported Version|_Any_|_(Yes)_|
            |Most Recent Bug-Fix Release| | |
            |Previous Major Release| | |
            |Most Recent LTS| | |
            |Previous Supported LTS| | |
            |_Other Versions.._| | |
            |_(Add rows as needed)_| | |

             
            Yinon Negev created issue -

              a64d184ae8e6 Yann
              8cdc82c96fd5 Yinon Negev
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: