This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Update ticket using powershell

Hello all, I'm posting this question here in the hopes that somebody can point me to the right direction. I should say that I have a beginner knowledge of powershell and api. We are using Web Help Desk version 12.5.2.

What I want to accomplish is to create ticket and update ticket using powershell script. I am able to issue a Get method no problem. But if I issue a POST or PUT method I get an error.

The error says “Invoke-RestMethod -Uri "helpdesk_URL/.../Helpdesk …

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

| Apache Tomcat/7.0.82 - Error report HTTP Status 403 - type Status reportmessage description Access

| to the specified resource has been forbidden.Apache Tomcat/7.0.82



Here's my script.



Param(
[string]$apikey = "our_api_key",
[string]$ticketNumber,
)

#Write ticket details to JSON
$json=@"
{
"statustype": {
"type": "StatusType",
"id": 4
}
}
"@

### This is where the script fails ####

#Update/Close Ticket
Invoke-RestMethod -Uri "">helpdesk_URL/.../$($ticketNumber) -Method PUT -Body $json -ContentType "application/json"

Parents
  • Have you tried the Import process to add tickets instead?  I don't know about powershell but I would be careful adding directly to the WebHD tables, there are tons of foreign keys linking to many other tables.

Reply
  • Have you tried the Import process to add tickets instead?  I don't know about powershell but I would be careful adding directly to the WebHD tables, there are tons of foreign keys linking to many other tables.

Children
No Data