Ticket Responder Reply
Bug
When a ticket responder replies and his reply is inserted by the email collector then in the ticket general there is no info to know that there is reply for this ticket... Instead you have to go to the the ticket to read the message but if you do not know that there is new message you will never go ...
Environment
- Version: [14.0.4]
- OS: [CentOS 7]
- Web server: [Apache 2.4.6]
- PHP: [7.4.26]
- Database: [MySQL 5.5.68]
Expected and actual behavior
I feel the same feature missing but not sure how to do it Maybe change de status to "not read" like of the ticket was just created ?
I do not know how do it ....Can you explain it to me ?
Any news regarding this issue ..?
Hi , please don't comment every few days , you can either :
- Propose a PR to help this issue
- sort your ticket list by modification date to show the last answers
- monitor your email to see that there was an answer
I would classified this as low priority
Bug still exists !
Hello,
Is it still the case on V18 ?
Yes it is ...Nothing is improved or chnage to v 18 ...about this issue
- sort your ticket list by modification date to show the last answers
Unfortunately, it is not usable because this date is not modified when the ticket is answered (maybe a bug ?)
I created a simple python script handling "Collect_Responses_In" messages: If such a new message is detected it sets the ticket status to "unread" again. (Only works if status is set to "waiting for feedback" before). Make sure to have API Module enabled and you configured your API-Key and dolibarr correctly in this script. Great to be ran as cronjob every five minutes:
import json
import os
FULLURL = ('https://dolibarr.example.com/api/index.php/').replace('//api', '/api')
HEADERS = {'DOLAPIKEY': "myapikey"}
import requests
import time
def get_request(url, json=None):
print(f"(GET request to {url})")
retrycounter = 0
while retrycounter < 3:
try:
response = requests.get(url, headers=HEADERS, json=json)
return response
except requests.exceptions.RequestException as e:
retrycounter += 1
print(f"Request failed, retrying {retrycounter} time(s)")
time.sleep(1)
def put_request(url, json=None):
print(f"(PUT request to {url})")
retrycounter = 0
while retrycounter < 3:
try:
response = requests.put(url, headers=HEADERS, json=json, timeout=15)
return response
except requests.exceptions.RequestException as e:
retrycounter += 1
print(f"Request failed, retrying {retrycounter} time(s)")
time.sleep(1)
# Load json file
all_read_message_ids = []
if os.path.exists('all_message_ids.json'):
with open('all_message_ids.json') as f:
all_read_message_ids = json.load(f)
# Get all latest 500 tickets
response = get_request(FULLURL + 'tickets?limit=500&sortfield=t.rowid&sortorder=DESC')
tickets = response.json()
# Only get all the tickets with status 5 (waiting for feedback)
tickets = [ticket for ticket in tickets if ticket['status'] == "5"]
for ticket in tickets:
# Get all messages for this ticket
response = get_request(FULLURL + 'tickets/' + str(ticket['id']))
ticket_with_messages = response.json()
messages = ticket_with_messages['messages']
for message in messages:
# Check if message is a response from the user (from Collect_Responses_In Email Collector procedure)
if "Collect_Responses_In" in message["message"] and message["id"] not in all_read_message_ids:
# Update ticket status to 0 (unread)
response = put_request(FULLURL + 'tickets/' + str(ticket['id']), json={"fk_statut": "0"})
all_read_message_ids.append(message["id"])
# Save all read message ids to json file (in case of script failure in the future)
with open('all_message_ids.json', 'w') as f:
json.dump(all_read_message_ids, f)
Thanks for sharing. Could be done also with a n8n or zapier workflow.