freescout icon indicating copy to clipboard operation
freescout copied to clipboard

WorkFlow scenario not working [Last reply from]

Open PeopleInside opened this issue 1 year ago • 1 comments

Some details:

  • PHP version: 8.3
  • FreeScout version: 1.8.120
  • Database: MySQL
  • Are you using CloudFlare: Just the name server but not using Cloudflare proxy
  • If you need know the version of the Workflow module let me know. I don't know if I can post here.
  • If I should not open an issue about a module, please let me know and sorry in advance, I can explain why I'm opening an issue here.
  • I had read FAQ and also website help section.

Premise: Other workflow tested (different from what I'm reporting) works, Freescout time is correct because I checked on the page system/status

What seems is not working? All workflows I have created that has rule to check "Last customer reply" or "Last operator reply" seems are not working.

1. The first workflow that is working:

I created a workflow to add two tags: one that indicate that operator replied to the ticket "risposta operatore" and a tag that indicate the ticket is pending user feedback "in attesa di feedback utente".

This works with the condition: 1c. New / reply / moved , user or customer replied and status is equal to pending Actions

  • Add the two tags

This workflow works!

Screenshot 1 of 2 Screenshot 2024-02-04 131207

Screenshot 2 of 2 Screenshot 2024-02-04 131213

So when the operator made a reply to the customer, the default ticket status will be changed on pending and the workflow to add the two tags will be trigged. Now the ticket of the customer will be pending, will have a reply from the operator and two tags "replied by the operator and waiting user feedback"

2. The second workflow that is not working:

Condition:

  1. status is equal to pending
  2. Last customer reply is not in the last 3 days
  3. Tags doesn't contain "in lavorazione" (translation: working)
  4. Tags contain "in attesa di feedback utente" (translation: waiting user feedback)

Actions

  • Reply to conversation
  • Add Tag "Chiuso automaticamente" (translation: closed automatically)
  • Change status: closed
  • Remove Tags "in attesa feedback utente" (translation: waiting user feedback)

Screenshot 1 of 2 Screenshot 2024-02-04 130711

Screenshot 2 of 2 Screenshot 2024-02-04 130719

3 days since user and operator replies has been past. The label waiting user feedback was present in the pending ticket, the status was pending and no working label was present. The workflow has not been applied.

I tried to change the days from 3 to one and apply to the previously tickets but also in this case the Workflow doesn't works.


I hope this topic can help to figure out why and discover if there are some bugs issue. Thank you.

PS: I will continue to monitoring this to try to understand what can be the cause of this issue. I have also a workflow that add a view label if the ticket has been view by the customer. I need to test if the fact a workflow is called maybe forbid another workflow, that should work, to work correctly.

PeopleInside avatar Feb 04 '24 12:02 PeopleInside

I have to confirm this issue. I created a test MailBox just to test better this BUG.

The test Mail Boxes has no workflow setup so I setup the following Work Flow: Screenshot 2024-02-04 211614 Screenshot 2024-02-04 211625

Screenshot 2024-02-04 213112

Screenshot 2024-02-04 211639

Screenshot 2024-02-04 211658 Screenshot 2024-02-04 211723 Screenshot 2024-02-04 211746

As you can see in the screenshots two ticket are present. One created by the web interface and the other one created by email.

Both tickets has not activated the automatic workflow. In the email ticket test there is also the operator reply old more then 1 hours (1 hours showed in the screnshot) but workflow has not send any alert and has not closed the ticket.

Still not closed, no label added: immagine

PeopleInside avatar Feb 04 '24 20:02 PeopleInside

Hello, I think you misunderstood "tags". A tag is a single word only, so "in lavorazione" is actually 2 tags, "in" and "lavorazione". Looking at it in that way, your conditions are "must contain _in_ " and "must not contain the tag _in_ " - so the workflow will never apply. Ciao, credo che tu abbia frainteso i "tag". Un tag è una sola parola, quindi "in lavorazione" è in realtà 2 tag, "in" e "lavorazione". In questo modo, le tue condizioni sono "deve contenere _in_" e "non deve contenere il tag _in_" - quindi il flusso di lavoro non sarà mai applicato.

Ciao, Peter

netlane avatar Mar 01 '24 10:03 netlane

Hi, Ciao Peter (netlane), thank you for your reply!

Hello, I think you misunderstood "tags". A tag is a single word only, so "in lavorazione" is actually 2 tags

Umh this is interesting. Hard for me to understand alone as I use other software where tag is all inside the same background rectangle.

Also when I tell to a workflow to add a tag like "in lavorazione" the tag is added successfully just discovered some workflow is not working as expected.

I will maybe try to test workflow with different tag that has no spaces between words and see if with this I'm able to see workflow working correctly. Thanks.

I will keep this issue open for now as still be valid but I will try to test with tags of just one words and no spaces between letters.

PeopleInside avatar Mar 01 '24 10:03 PeopleInside

I'm asking if I can use "in_lavorazione" so replace the space with the underscore character. Will this work to be only one tag? I have to test this.

PeopleInside avatar Mar 01 '24 10:03 PeopleInside

Check the list of your tags in Administration > tags (The url of that page is yourdomain.com/tags )

netlane avatar Mar 01 '24 11:03 netlane

I know and all seems to be fine here. I see spaces are used to be in the tag as I expect. I started to test tags without spaces

immagine

PeopleInside avatar Mar 01 '24 11:03 PeopleInside

If you also see the developer extension pages https://freescout.net/module/tags/ tags are showed in images with spaces so I think space are supported and should maintain the tag to be a single tag.

PeopleInside avatar Mar 01 '24 11:03 PeopleInside

Ok, so I was wrong, sorry :( Please check my new issue #3840 - when the last reply was from a user (you) then there exists no last customer reply. This could also be your problem.

netlane avatar Mar 01 '24 11:03 netlane

Hi, why this issue has been flagged as resolved? From my recent test with FreeScout issue still be present even on the latest release.

I will monitor my open issue here: https://github.com/freescout-helpdesk/freescout/issues/3762

PeopleInside avatar Mar 08 '24 11:03 PeopleInside

If you also see the developer extension pages https://freescout.net/module/tags/ tags are showed in images with spaces so I think space are supported and should maintain the tag to be a single tag.

No. Only one tag can be specified in Workflows conditions or actions.

freescout-helpdesk avatar Mar 08 '24 11:03 freescout-helpdesk

No. Only one tag can be specified in Workflows conditions or actions (no spaces or commas allowed).

Thanks for the reply but I'm unable to understand what you are saying.

Only one tag can be specified in Workflows

What this means? A workflow can have just one tag as condition or action and if a tag is present in the condition cannot have a tag action? Your system never limitate the actions or condictions.

I don't understand. If only one tag is supported then your system should never allow me to add more tags or have multiple actions and condictions.

I'm not understanding. I'm unable to have ticket overdue workflow.

Unable to have a reminder that alert me if a ticket never get an operator reply in 13, 24 and 48 hours. I'm also unable to close a ticket if customer never reply to the operator reply.

I created workflows but no one is working.

I'm unable to find a guide how to setup ticket auto close or ticket overdue.

I opened issues here in GitHub with a lot of screenshots that showed what workflow I created and it's not working and I'm still hoping in a fix or some help to understand why I'm unable to use workflow for overdue and for close tickets automatically.

PeopleInside avatar Mar 08 '24 12:03 PeopleInside

Try to add conditions one-by-one to (status, tags, etc) to identify the reason.

freescout-helpdesk avatar Mar 08 '24 12:03 freescout-helpdesk

I will try to run other test but I do a lot of test. Some workflow works, some one else not.

I will do other test but... I'm quite sure something is not working correctly. Thanks for the reply and for re-opening this.

What I expect to be able to do is:

  • Set a workflow that remind operator to reply to an active ticket that is never get a reply from operators in 12, 24 and 48 hours and also send an email to the customer.
  • Set a workflow that close a ticket if is pending and if no reply from customer has been made after the operator reply.

Currently no one of this workflow are working. I was just able to see the first overdue label and email. When I do test i change the 12, 24 and 48 hours to be 1 hours, 2 hours, 3 hours.

I will test better and update you but I'm sure something is not working correctly in workflow. I'm testing very and really simply workflow, nothing of complex.

What and how I'm testing:

Screenshot 2024-03-08 140019

As you can see I have just three workflow to be alerted if a ticket is missing operator reply in 1, 2 and 3 hours. This workflow are for overdue notification to operator and customer.

frsc overdue workflow

The other two workflow are for closing ticket if no reply from the customer, after the operator has made a reply, is done.

frsc closure ticket

I'm now testing if an existing ticket is closed after operator reply. The ticket should be closed after 4 hours as from the workflow.

Screenshot 2024-03-08 141809

I'm also now testing ticket overdue workflow

immagine

Let's see if I get alert on the first hours without a reply, the second and the third.

PeopleInside avatar Mar 08 '24 12:03 PeopleInside

Great, test of today ended and I confirm all bugs regarding workflow that I reported. Please see my screenshots and read this simple description of the issue:

What and how I'm testing:

Screenshot 2024-03-08 140019

This is my workflow list in my testing instance where I'm trying to reproduce bugs for see your fix and have the fix also in my production installation.

As you can see I have just 5 workflow. There is not an high number.

3 workflow are for send an operator and a customer alert if a ticket is opened but is missing a reply from the operator in 1 hours, 2 hours, 3 hours.

Only the first workflow is working so after 1 hour the overdue1 label is added. The workflow is set to execute for a max of three time.

I expect after another hour again email alert are sent again but they are not.

Also the second alert workflow is not triggering, I don't know why so I never get the email and the label overdue2 in the second workflow, same for the third.

As you can see I have just three workflow to be alerted if a ticket is missing operator reply in 1, 2 and 3 hours. This workflow are for overdue notification to operator and customer.

frsc overdue workflow

The other two workflow are for closing ticket if no reply from the customer, after the operator has made a reply, is done.

frsc closure ticket

I'm now testing if an existing ticket is closed after operator reply. The ticket should be closed after 4 hours as from the workflow.

Also the workflow for close the ticket if no reply from customer is made, is not working.

immagine

As you can see in this image only the overdue1 label was applied. As I told only first overdue workflow worked and also was not repeated as I expect as I set to run max 3 time so after another hours I expect another alert is sent but is not. So even in this workflow one I find a BUG.

The other two workflow to apply overdue2 and overdue3 was not triggered and this seems to be a BUG.

I done two type of ticket testing: one ticket opened by the customer without operator reply

the second one a ticket with the operator reply that add the replied label and should close the ticket if no reply by customer is made on more then 4 hours.

7 hours has been past and the ticket still be opened

Also the workflow to close the ticket after 4 hours was not applied, the ticket still be opened after more then 4 hours. Workflow are not correctly working for me.

immagine

I can confirm so workflow are unable to due a correct overdue scenario that work only one time. Only overdue1 label has been added after 1 hour. That workflow was also set to execute max of three time so, I expect after another hour the workflow should be triggered again and send again notification but was not triggered, no other email notifications has been sent.

The workflow also was never able to close the ticket with the operator reply that was not having any reply back from the customer. The workflow was set to close the ticket if the replied label was present and no reply from the customer was made.

After 7 hours the ticket still be opened and not closed automatically.

I confirm all bugs and I hope you can test and fix.

immagine

As you can see the ticket is pending has never changed his status to closed.

The other two workflow are for closing ticket if no reply from the customer, after the operator has made a reply, is done.

frsc closure ticket

I'm now testing if an existing ticket is closed after operator reply. The ticket should be closed after 4 hours as from the workflow but is not.

PeopleInside avatar Mar 08 '24 20:03 PeopleInside

Are you running cron jobs every minute? https://github.com/freescout-helpdesk/freescout/wiki/Installation-Guide#9-configuring-cron-jobs

Try to manually kill background queue:work process and see how it goes: https://github.com/freescout-helpdesk/freescout/wiki/Background-Jobs

If still no luck you'll need to debug checkConditions() function in /Modules/Workflows/Entities/Workflow.php (line 724): https://github.com/freescout-helpdesk/freescout/wiki/Debugging

freescout-helpdesk avatar Mar 09 '24 04:03 freescout-helpdesk

Are you running cron jobs every minute?

Yes I'm.

Workflow are working where is not bugged.

Can I ask, are you able to create a scenario where you have 3 overdue alert for every hour ( 1 hour, 2 hour and 3 hour) that add 3 different label overdue1, overdue2, overdue3 and send an email notification?

Are you able to create a scenario where if the customer DO NOT reply to the operator reply after some times the ticket is auto closed?

Could you please test this and maybe share (as me) what workflow you created for made it work? I hope if you test this you will see this scenario are not working so maybe you can release a fix.

I want you to understand that my installation is fully working means ticket are created from email, some workflow are correctly working. What is not working is some specific very simple workflow so looks to me this are bugs in the workflow module.

For example the conduction Last Customer Reply seems is not working.

Are you able to have the following workflow working for you?

immagine

Screenshot 2024-03-09 081414

You can skip the replied label action if you want

immagine

I think if you test this you will find one of the workflow bugs and issues I'm reporting. I don't think the issue it's from me because other workflow works.

I'm pretty sure I'm reporting valid bug about workflow also if sound strange to me you have this kind of bug because with this issues I'm unable to replicate what is present on ZenDesk.

On ZenDesk there are more overdue alert to the user if the operator are unable to reply and also the ticket is automatically closed if the customer miss, stop to reply to the operator.

I was able to see the overdue workflow work only for the first alert, not for the second and the third one. I'm sure this issues can be easily reproduced by anyone.

PeopleInside avatar Mar 09 '24 06:03 PeopleInside

Are you able to create a scenario where if the customer DO NOT reply to the operator reply after some times the ticket is auto closed?

Yes. You should use "Is not in the last" 4 hours condition. On your screenshot (before editing) it was "Is in the last" 4 hours.

2024-03-09_10-13-21

Also no need to add many scenarios into one issue. It makes it difficult to understand and debug. Good luck.

freescout-helpdesk avatar Mar 09 '24 07:03 freescout-helpdesk

I'm not the only one who fix a message editing it, you done the same in this conversation where you said (before edit a previous message) that spaces in tags are not supported.

You should use "Is not in the last" 4 hours condition. On your screenshot (before editing) it was "Is in the last" 4 hours.

I know, this is why the screenshot was corrected. I'm still testing what I'm reporting and I'm sure there is some bug in the workflow.

So you was recently able to create an overdue workflow that add overdue1, overdue2 and overdue3 labels and send alert by email? I don't believe you tested this.

Now I'm again testing the auto closure of a ticket but I have already tested in the past with the correct "Is not in the last" 4 hours condition and still not work.

You are free maybe to close the issue and ignore what I'm reporting. Looks quite strange you are able to made this two workflow for overdue and for ticket closure working.

I was hoping in a fix from you. Looks strange to me all works except some workflow, this let me think there is issues and bug on workflow module.

Oh I see you attacked a test screenshot. Strange... ok thanks for the help.

PeopleInside avatar Mar 09 '24 07:03 PeopleInside

So you was recently able to create an overdue workflow that add overdue1, overdue2 and overdue3 labels and send alert by email?

Yes. It works fine on our end.

2024-03-09_14-01-03

freescout-helpdesk avatar Mar 09 '24 11:03 freescout-helpdesk

Is strange. Maybe so the issue is in how my FreeScout is installed?

Is installed in a subfolder like helpdesk.domain.ext/support

Maybe something related on how I installed Free scout as for the tools.php page not loading fully CSS maybe your install is installed differently.

I cannot understand how it works to you and not to me and not all workflow are broken just I'm able to trigger the overdue just once and I'm unable to see ticket auto closed.

Will still be a mastery for me.

PeopleInside avatar Mar 09 '24 11:03 PeopleInside

All our suggestions are here: https://github.com/freescout-helpdesk/freescout/issues/3761#issuecomment-1986729263

freescout-helpdesk avatar Mar 09 '24 11:03 freescout-helpdesk

Thanks immagine Maybe I need try to resolve this last thing in red? All other things seems fine.

For debug I have to add a string of code in /Modules/Workflows/Entities/Workflow.php?

Need add

\Log::error('[Debugging] some variable value: '.$some_variable);

as showed or this string should be customized? Need add this code line to the file?

I have to ask on the Plesk forum how can I resolve this missed component. Maybe this is the cause of my issue?

On SSH command I see only pcntl_signal seems missing but is I open the UI at system/status I see two line flag as component missed.

immagine

I have to see if I'm able to resolve this if this can be the cause of mine issue.

PeopleInside avatar Mar 09 '24 11:03 PeopleInside

Hi, I run a process to activate the pcntl on Plesk PHP 8.3.3 https://talk.plesk.com/threads/how-to-add-pcntl-support-to-php-8-3.373618/

Doing the SSH command /opt/plesk/php/8.3/bin/php -m | grep pcntl show me a red line with pcntl , this should means the component is running?!

If I open the /system/status page still showing to me

311437275-0e348cb7-7ef4-48ad-a690-52a3c23c1f4f

Any idea why and how can I resolve this?

I need configure something else as I do some process to activate this on PHP after the Freescout install?

immagine

What I should do?

PeopleInside avatar Mar 10 '24 16:03 PeopleInside

It means pcntl_signal function is disabled in your PHP and PHP can not kill processes. You need to enable this function.

freescout-helpdesk avatar Mar 10 '24 16:03 freescout-helpdesk

Any idea on how to enable it? I'm searching for that but I fund only instructions on how to see run pcntl but pcntl seems is running. I will still investigate, I'm looking how to enable pcntl_signal on Plesk.

PeopleInside avatar Mar 10 '24 16:03 PeopleInside

From the server side actually seems all is maybe working. I do everything I think should be require to activate pcntl.

Someone has told in the config/installer.php, pcntl is commented in the required extension. I'm sure that I dont need change something in your app for see pcntl working?

PeopleInside avatar Mar 10 '24 19:03 PeopleInside

Hum I tested in a test VPS on Plesk and all was working. Seems there is an issue on my productive server where I followed the procedure to enable pcntl and from the php info file I see that pcntl is active but freescout still show pcntl_signal not found.

I checked also php.ini file and there is no disable row for pcntl.

Any idea where I can look to understand why freescout is not finding pcntl_signal?

PeopleInside avatar Mar 12 '24 12:03 PeopleInside

pcntl_signal function can be disabled in some PHP config for example: https://stackoverflow.com/questions/52791039/pcntl-async-signals-has-been-disabled-for-security-reasons-ubuntu-16-lara

freescout-helpdesk avatar Mar 12 '24 13:03 freescout-helpdesk

Thanks for the reply. I'm always in Plesk test VPS and production VPS. As I told I don't see any php config where this is set to be disabled.

In the link given by you https://stackoverflow.com/questions/52791039/pcntl-async-signals-has-been-disabled-for-security-reasons-ubuntu-16-lara

the screenshot show the command php artisan queue:work then a security message is printed.

There is a similar procedure I can do with FreeScout to see if is a permission issue? Currently I was not able to have any particular error that let me think there is a block somewhere.

I will continue to investigate this anyway.

The command /opt/plesk/php/8.3/bin/php -i | grep pcntl

Give to me pcntl pcntl support => enabled

but freescout still not see this. What can be? Hard to understand for me

PeopleInside avatar Mar 12 '24 13:03 PeopleInside

I'm still investigating the issue with the Plesk team, also. They was able to made the SSH command: /opt/plesk/php/8.3/bin/php artisan freescout:check-requirements

give all results ok but in the web UI the page still say pcntl_signal (console PHP) not found.

Strange issue, there is a command I should run to update the UI?

In any case seems made pcntl_signal work on Plesk is or easy or very hard.

In one test server every step I did activated successfully without any issue all. In two other server is not working fully.

In my production server I have to understand what Plesk did to resolve the requirement by SSH but still not resolved in the UI. In the test server they was able to get all OK in SSH but not in the web interface where pcntl_signal still showed as missed. Any idea on why SSH say OK and UI not?

PeopleInside avatar Mar 15 '24 12:03 PeopleInside