Jump to content

nickwilliams999

Member
  • Posts

    7
  • Joined

  • Last visited

Everything posted by nickwilliams999

  1. Hi, In the interest of sharing, I just thought I would share some code I have written to find out the amount of time it took to respond to a ticket, excluding and auto-response. SELECT t.id AS TicketID, t.title, t.message, t.status, t.urgency, t.date, ttr.tid, ttr.message, MIN(ttr.date) AS TicketReplyDate, TIMEDIFF(ttr.date, t.date) AS FirstResponseTime FROM tblticketreplies ttr JOIN tbltickets t ON ttr.tid = t.id WHERE ttr.message NOT LIKE '%Thanks for reaching out!%' GROUP BY ttr.tid ASC In addition to this, I also converted the FirstResponseTime to an integer within my reporting tool, this was outside of the SQL code: FirstResponseDurationInMinutes = DATEDIFF('Support Ticket Response Times'[date], 'Support Ticket Response Times'[TicketReplyDate], MINUTE) FirstResponseDurationInHours = 'Support Ticket Response Times'[FirstResponseDurationInMinutes] / 60 This is certainly a requirement in KPI reports we run, so hopefully someone finds this useful! Nick
  2. Hi, I just wanted to post that I have figured out the answer to this for anyone who has this issue in the future... I think what this came down to is that JSON.stringify and btoa was sending something different than what WHMCS was expecting. With this in ming i replaced these functions with: http://locutus.io/php/url/base64_encode/ and http://locutus.io/php/var/serialize/ const module = { // 47 is the ID in tblcustomfields for the customfield // data[0] is the data passed to the page 47: data[0] } // Serialize const moduleserial = serialize(module); addClient .addClient({ customfields: base64_encode(moduleserial) }) Enjoy 🙂 Regards, Nick Williams
  3. I have tried an associative array, still no luck! Any help is really appreciated! const testcustomfield = { "1": "Saab", "1": "Volvo" }; const testcustomfieldserial = JSON.stringify(testcustomfield); addClient .addClient({ customfields: btoa(testcustomfieldserial) })
  4. Just an update, I am trying this but it is still not working... var testcustomfield = new Array("Saab", "Volvo", "BMW"); const testcustomfieldserial = JSON.stringify(testcustomfield) addClient .addClient({ customfields: btoa(testcustomfieldserial), })
  5. Hi, I am using whmcs-js for node and I have setup the add client method as described in the whmcs documentation. This is working as expected, however, it is not working when i have added the custom field option. I cant understand how to associate the data being passed here into the custom field created in whmcs... Btoa converts it to base64 and json.stringify to a string. This is the code: const custommoduledata = JSON.stringify(req.body.selected) // Call the getClients call and store the data in the variable called addClient .addClient({ firstname: req.body.firstname, lastname: req.body.lastname, email: req.body.email, address1: req.body.Address1, address2: req.body.Address2, city: req.body.City, state: req.body.State, postcode: req.body.Postcode, country: req.body.Country, phonenumber: req.body.Phone, customfields: btoa(custommoduledata), notes: 'test', language: 'english', skipvalidation: true }) There is one custom field in whmcs called: MODULE in which I would like this items to go. Any help appreciated
  6. Hey, What i want to do is have a WHMCS server where it has one domain and all users will have a subdomain E.g. user.mydomain.com. This will be used in a learning environment, so the package will be free. I have read through the support files and when setting up the package i have gone to other and added .mydomain.com. The package creates... happy days. HOWEVER, how do i make it automatically add the A record for the subdomain? as when i type in the subdomain (x.mydomain.com) it throws up a Forbidden / No permission to access / on this server. I have read so many posts from here/google and it appears possible, however nowhere can i see a definitive answer. This being automated has a massive impact, i intend to have around 3 - 400 users at a time and i certainly dont want to add each individually. I am running cPanel/whm. Any help would be appreciated Nick
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated