homotechsual / NinjaOne

MIT License
85 stars 25 forks source link

incomplete ticket data when using Get-NinjaOneTicketLogEntries #15

Closed notadevcollins closed 1 year ago

notadevcollins commented 2 years ago

when I run Get-NinjaOneTicketLogEntries -ticketID '1015'

I get back

@{id=69; appUserContactUid=; type=SAVE; body=Ticket updated by Automation 'Close Tickets Trigger'; htmlBody=; isEmailResponse=False; fullEmailBody=; publicEntry=True; system=True; createTime=1661881121.958; changeDiff=; activityId=; timeTracked=} @{id=61; appUserContactUid=1b0f9d59-e236-4a8c-9ba7-b3bfeb9e505d; type=SAVE; body=Ticket updated; htmlBody=; isEmailResponse=False; fullEmailBody=; publicEntry=True; system=True; createTime=1661792032.645; changeDiff=; activityId=; timeTracked=} @{id=60; appUserContactUid=1b0f9d59-e236-4a8c-9ba7-b3bfeb9e505d; type=COMMENT; body=performed fake task that took 1 and a half hours; htmlBody=<p>performed fake task that took 1 and a half hours </p>; isEmailResponse=False; fullEmailBody=; publicEntry=True; system=False; createTime=1661792022.011; changeDiff=; activityId=; timeTracked=5400} @{id=59; appUserContactUid=1b0f9d59-e236-4a8c-9ba7-b3bfeb9e505d; type=SAVE; body=Ticket created; htmlBody=; isEmailResponse=False; fullEmailBody=; publicEntry=True; system=True; createTime=1661791970.832; changeDiff=; activityId=; timeTracked=} @{id=58; appUserContactUid=1b0f9d59-e236-4a8c-9ba7-b3bfeb9e505d; type=DESCRIPTION; body=example ticket that will be used with invoice ninja; htmlBody=<p>example ticket that will be used with invoice ninja </p>; isEmailResponse=False; fullEmailBody=; publicEntry=True; system=False; createTime=1661791970.823; changeDiff=; activityId=; timeTracked=0}

when I use my browser to go to https://app.ninjarmm.com/v2/ticketing/ticket/1015/log-entry I get

[{"id":69,"appUserContactUid":null,"type":"SAVE","body":"Ticket updated by Automation 'Close Tickets Trigger'","htmlBody":null,"isEmailResponse":false,"fullEmailBody":null,"publicEntry":true,"system":true,"createTime":1661881121.958000000,"changeDiff":{"status":{"new":"CLOSED","old":"RESOLVED"}},"activityId":null,"timeTracked":null},{"id":61,"appUserContactUid":"1b0f9d59-e236-4a8c-9ba7-b3bfeb9e505d","type":"SAVE","body":"Ticket updated","htmlBody":null,"isEmailResponse":false,"fullEmailBody":null,"publicEntry":true,"system":true,"createTime":1661792032.645000000,"changeDiff":{"status":{"new":"RESOLVED","old":"NEW"}},"activityId":null,"timeTracked":null},{"id":60,"appUserContactUid":"1b0f9d59-e236-4a8c-9ba7-b3bfeb9e505d","type":"COMMENT","body":"performed fake task that took 1 and a half hours","htmlBody":"<p>performed fake task that took 1 and a half hours </p>","isEmailResponse":false,"fullEmailBody":null,"publicEntry":true,"system":false,"createTime":1661792022.011000000,"changeDiff":{},"activityId":null,"timeTracked":5400},{"id":59,"appUserContactUid":"1b0f9d59-e236-4a8c-9ba7-b3bfeb9e505d","type":"SAVE","body":"**Ticket created","htmlBody":null,"isEmailResponse":false,"fullEmailBody":null,"publicEntry":true,"system":true,"createTime":1661791970.832000000,"changeDiff":{"ccList":{"new":{"uids":null,"emails":[]},"old":null},"nodeId":{"new":{"name":"customer user"},"old":null},"source":{"new":"TECHNICIAN","old":null},"status":{"new":"NEW","old":null},"summary":{"new":"Test Ticket do not bill 1","old":null},"clientId":{"new":{**"name":"Customer name"},"old":null},"priority":{"new":"MEDIUM","old":null},"severity":{"new":"MODERATE","old":null},"locationId":{"new":{"name":"Main Office"},"old":null},"requesterUid":{"new":{"name":"my name** "},"old":null},"ticketFormId":{"new":{"name":"Default"},"old":null},"attributeValues":[{"new":"true","old":null,"attributeId":**{"id":1,"name":"Site Visit","attributeType":"CHECKBOX"}}],"assignedAppUserId":{"new":{"name":"my name"},"old":null}},"activityId":null,"timeTracked":null},{"id":58,"appUserContactUid":"1b0f9d59-e236-4a8c-9ba7-b3bfeb9e505d","type":"DESCRIPTION","body":"example ticket that will be used with invoice ninja","htmlBody":"<p>example ticket that will be used with invoice ninja </p>","isEmailResponse":false,"fullEmailBody":null,"publicEntry":true,"system":false,"createTime":1661791970.823000000,"changeDiff":{},"activityId":null,"timeTracked":0}]

noteably its missing the customer name and the name of the person who worked on the ticket

not sure if I'm doing something wrong or if part of the response is being parsed out