Need some help with Workflow.
I need a workflow to scan every minute the cases, find the cases that the last email that was received is not replied, and change the status of these cases to a status that I created that is "Needs Reply"
I now have created a Case Report with filters:
status - none of: 'new' 'Needs Reply'
and
Emails.is Replied - No
Then I created a Scheduled (* * * * *) Case workflow with target report, the aforementioned.
and actions
The workflow log shows multiple entries of the Case that it should act upon, and nothing is changed.
Any ideas would be pretty much appreciated.
I need a workflow to scan every minute the cases, find the cases that the last email that was received is not replied, and change the status of these cases to a status that I created that is "Needs Reply"
I now have created a Case Report with filters:
status - none of: 'new' 'Needs Reply'
and
Emails.is Replied - No
Then I created a Scheduled (* * * * *) Case workflow with target report, the aforementioned.
and actions
PHP Code:
$lastemail = record\findOne('Email', 'createdAt', 'desc', 'parentId=', id,'fromEmailAddressId!=', '65476202572deca29','createdAt>', '2024-03-07');
$lastemailreplied = record\attribute('Email', $lastemail, 'isReplied');
ifThen($lastemailreplied == 'false',
record\update('Case', id, 'status', 'Needs Reply')
)
The workflow log shows multiple entries of the Case that it should act upon, and nothing is changed.
Any ideas would be pretty much appreciated.
Comment