definitions:
    issue_collaborators_definition:
        label: 'Add collaborators on create and update issue'
        enabled: true
        entity: Sbts\Bundle\IssueBundle\Entity\Issue
        order: 10
        actions_configuration:
            - @call_method:
                conditions:
                    @not_blank: [$reporter]
                parameters:
                    object: $.data
                    method: addCollaborator
                    method_parameters: [$reporter]
            - @call_method:
                conditions:
                    @not_blank: [$owner]
                parameters:
                    object: $.data
                    method: addCollaborator
                    method_parameters: [$owner]

triggers:
    issue_collaborators_definition:
        -
            event: create
            queued: false
        -
            event: update
            field: owner
            queued: false

definitions:
    issue_collaborators_definition:
        label: 'Add collaborators on create and update issue'
        enabled: true
        entity: Sbts\Bundle\IssueBundle\Entity\Issue
        order: 10
        actions_configuration:
            - @call_method:
                conditions:
                    @not_blank: [$reporter]
                parameters:
                    object: $.data
                    method: addCollaborator
                    method_parameters: [$reporter]
            - @call_method:
                conditions:
                    @not_blank: [$owner]
                parameters:
                    object: $.data
                    method: addCollaborator
                    method_parameters: [$owner]

    issue_add_note_definition:
        label: 'Add collaborator and refresh updatedAt on adding new note to issue'
        enabled: true
        entity:  Oro\Bundle\NoteBundle\Entity\Note
        order: 20
        actions_configuration:
            - @call_method:
                object: $.data
                attribute: $.isIssue
                method: supportTarget
                method_parameters: ['Issue']
            - @create_datetime:
                condition:
                    @true: $.isIssue
                attribute: $.data.target.updatedAt
            - @call_method:
                condition:
                    @true: $.isIssue
                object: $.data.target
                method: addCollaborator
                method_parameters: [$owner]

triggers:
    issue_collaborators_definition:
        -
            event: create
            queued: false
        -
            event: update
            field: owner
            queued: false
    issue_add_note_definition:
        -
            event: create
            queued: false

Update collaborators and issue.updatedAt on adding note
OOT-637: Update collaborators and issue.updatedAt on adding note
