How to move a ticket from solved to closed after four days?

Hello,

In my plumsail helpdesk system, I am looking to have tickets that haven't had any activity for four business days to move from the solved status to a custom status I created, called "closed."

Initially I tried using SLA rules, but I couldn't get it to work.

I found that using the scheduler makes more sense anyway. I found these articles: Building advanced conditions — HelpDesk for Microsoft 365, MS Teams, and SharePoint 1.x documentation & Close tickets if customer hasn’t replied in SharePoint help desk system — HelpDesk for Microsoft 365, MS Teams, and SharePoint 1.x documentation and based my new scheduler task off of them.

Here is what I created:

I used [Ticket.Metadata.LastCommentDate] to pull the date and time of when the ticket was last responded to.

When I save and click "run now," it runs but no tickets are modified. I have confirmed we have many tickets that are solved and have a last comment added more than four days ago.

Can someone tell me where I'm going wrong here? Thanks in advance.

Hello Jake! Please use this reference in the condition:

[Ticket.MetadataLastCommentDate.LastCommentDate]

When referring to lookup columns, you need to append an internal name of the lookup column and one of the column it refers to.

That makes sense, thanks for the tip!

Unfortunately, though, it didn't fix my issue as I ran the scheduler and 0 tickets were changed. Any other tips?

Could you share the run logs and a sample ticket that should be modified? Please ensure that columns 'Ticket ID', 'Status', 'Modified', and 'Last comment date' are visible on the screenshot.

Ok, I dm'd you these items

I reproduced the issue when added the status condition. I will consult with developers and get back to you soon.

Jake, it is by design that scheduler tasks can retrieve only unsolved tickets that were modified during the last 30 days. I would advise you to use either other statuses in the condition or a Power Automate flow with the same logic. If you need help with the latter, let me know.

Ok, I understand.

I think our options then are to either delete the Solved status and create a new one (I was thinking about creating one named "Resolved" instead), or to use the power automate flow.

Could you advise on how best to build the flow and if it would work as well as the scheduler does? That would be the preferred option if it works well. Thanks in advance!

Yes, you can use the approach with another custom status 'Resolved'. If you wish to stick to solution with the Power Automate flow, the instruction is below.

Create a custom column to store the last comment date:

Configure a trigger that will set a value in it on each comment creation:

Start the flow every business day at its beginning

Add a condition and check whether the current day is Friday. Use the expression below to get the current day in a certain time zone (change it if required):

dayOfWeek(convertTimeZone(utcNow(), 'UTC', 'Eastern Standard Time'))

If it is Friday, retrieve solved tickets with the last comment date earlier or equal to the four days ago. I got a day start and then added 8 hours to get the exact point of the business day beginning.

addHours(startOfDay(convertTimeZone(getPastTime(4, 'Day'), 'UTC', 'Eastern Standard Time')), 8)

If it is not Friday, go back for 6 days to skip Sunday and Saturday:

addHours(startOfDay(convertTimeZone(getPastTime(6, 'Day'), 'UTC', 'Eastern Standard Time')), 8)

Finally, update each of the retrieved tickets: change the status to the required and re-assign the existing required values.

1 Like

I tried this flow solution out and it seems to be working well. Thank you!

1 Like

Hey @Evgeniy, this solution has continued to work, but there are some oddities to it that I'd like help understanding.

There seems to be a delayed reaction on many of the tickets. We set it so that after four days since the last comment, it would be moved from solved to closed. This works for some, but for others it can take much longer than four days. See below for today's recent flow run:

We currently have 1,135 tickets with a "CustomLastCommentDate" from 4/5-4/15 still marked as "solved". We used to have a lot of tickets from 4/4 and before, but it seems they finally were all moved to closed now.

I'm sure there is more information I am missing here, but I hope this gives an idea as to what the problem is. I checked a bunch of the tickets in the above date range, and it doesn't seem there were any changes made to prevent them from having been moved to closed. I can't see any difference between the solved and closed tickets.

I will DM you the code view of the most recent successful flow run. Thank you in advance for any help.

Hello Jake!

Please try to set a 'Top Count' field in the 'Get items' steps to 2,000 and check whether the next run will modify all the required tickets. If it does not, please open the last run, unfold the 'Get items' step that worked and show or download raw inputs. If you show it, copy its content from the pane and save it as a text file. Do the same for raw outputs too. Also, check whether there were any failed iterations in the 'Apply to each' control. If so, please share raw inputs and outputs for several 'Update item' steps.

1 Like

Seems like setting it to 2000 fixed the issue. Thanks!

Hey @Evgeniy, as of a couple weeks ago, this process stopped moving items from solved to closed. The flow would run successfully but 0 items or one time only 1 item would move from solved to closed. There were many more that should have been moved.

I just manually ran the ticket closing flow again and this time it moved a couple dozen tickets to closed from solved, but only ones that are from March. We have hundreds of tickets that have sat for more than four business days since the last comment that are not moving to closed. I sent you the code from this most recent flow run in DM.

Do you have any idea as to how we can fix this issue? Thanks in advance!

Hello @Jake! Please run the flow manually again and ensure that some of the required tickets were not moved from solved to closed. Then take a screenshot of several such tickets, these columns should be visible: Ticket ID, Status, CustomLastCommentDate. Open the flow run and unfold the 'Get items' step that was performed in this run. Show raw inputs, copy it, and save as a text file. Do the same for the raw outputs and share the collected data. I would advise to raise a support ticket at support@plumsail.com, refer to this topic in your message.

Ok, I have raised a support ticket and referred to this topic and included all the information you suggested I include. Thank you!

Hi @Evgeniy, sorry to revive this post again, but we have made some changes to how we use ticket statuses, and no longer used the closed status as of right now.

Now I want to send the feedback surveys out after four days since the last comment was sent on solved tickets.

I am using the scheduler for this. Please see below for my current configuration:

I used a similar setup to what I did in the original post of this thread, based on the articles I linked. I am trying to have it set a column field (FourDays) to "Yes" once it has reached four business days since the last comment, and then I have another trigger to send out the feedback survey after the ticket has been modified with the field "FourDays" set to "Yes." See below for the trigger:

Am I on the right track with this? Unfortunately, when I click "Run Now" next to the scheduler, it gives me an error. Please help, thank you in advance.

Hello Jake! The system updates are not tracked by triggers so when the scheduled task sets the 'FourDays' field to 'Yes', the trigger won't run. It would be easier for you to send the notifications right in the scheduled task but it turned out that the action does not support tokens in the scheduler. I will consult with developers whether we can support them there.

As regards the error you encountered, I could not reproduce it and your configuration seems alright. Please ensure that you use the latest HelpDesk version (Settings > About) and clear browser cache. If the issue persists, load the page in incognito mode, open developer tools (F12), switch to the ‘Network’ tab, press Ctr+R, and reproduce the issue. Then export a HAR file:

Switch to the ‘Console’ tab, open the context menu of any record and save the logs:

Send the collected data and the screenshot of the error to support@plumsail.com and refer to this topic.

It was a false alarm: you can send notifications to requesters in the scheduled tasks too.

Ok, I've modified the scheduler and it seems to be set up right, but for some reason it isn't working. The HelpDesk version is up to date, but it returns either a (401) Unauthorized error or a blank error after running for 45 minutes to over an hour. See below. What am I doing wrong?