Syncro - Add Contact Information
Just something for Syncro users. Can probably be written better, but whatever. This is a Syncro powershell script to check for the assigned asset contact info and load it into the json file that helpdeskbutton v.3.26.4+ uses to pre-fill contact info. If you run this before installing helpdeskbutton, it won't be overwritten. Make sure to setup platform variables to match $contactname to {{contact_name}} and $contactemail to {{contact_email}}.
Import-Module $env:SyncroModule -WarningAction SilentlyContinue
if ($contactemail) {
$message = '{"PhoneCell": null, "phoneExt": null, "phoneBusiness": null, "businessName": null, "email": "' + $contactemail + '", "name": "' + $contactname + '"}'
$path = $env:appdata
Set-Content -Path $env:appdata\tier2tickets.json -Value $message
} else { }
Comments
Thank you for posting this!