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

XMLWordPrintable

    • Severity 3 - Minor

      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)    

       

            Assignee:
            Yann
            Reporter:
            Yinon Negev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: