Custom Triggers

Custom Triggers

I'm trying to figure out a way to run a trigger against the ticket that triggered it.

For example, if a ticket comes in about a user getting locked out of their AD account I want a custom trigger to run a script that edits the category and subcategory of THAT ticket. I could have the script edit a ticket I specify with the {request_id} parameter but I don't know how to make the request Id dynamic.

Here's an example for adding a time log to a ticket:

$inputData = @"

<Operation>

<Details>

<Worklog>

<workMinutes>15</workMinutes>

</Worklog>

</Details>

</Operation>

"@

$postParams = @{OPERATION_NAME = 'ADD_WORKLOG' ;TECHNICIAN_KEY = 'KEY' ;INPUT_DATA = $inputData }

$URI = "http://helpdesk:8080/sdpapi/request/{request_id}/worklogs"

Invoke-WebRequest -Uri $URI -Method Post -Body $postParams


This successfully adds a time log to whatever request Id is giving for {request_id}. But how am I able to make it dynamic?

I'm new to this and just digging in to it. This has me stumped though. Any help would be greatly appreciated.

Thanks!