Powershell REST API v3 Add-Worklog
Code below.
Gives response_status @{status=failed; messages=System.Object[]}
- $input = @"
- {
- "worklog": {
- "request": {
- "id": "$RequestID"
- },
- "description": "Adding a worklog",
- "technician": {
- "name": "Test User"
- },
- "total_time_spent": "0 Hrs 5 Mins"
- }
- }
- "@
- $header = @{TECHNICIAN_KEY=$ApiKey}
- $params = @{input_data=$input;format='json'}
- $Uri = $SdpUri + "/api/v3/worklog"
- $result = Invoke-RestMethod -Method POST -Uri $Uri -Headers $header -Body $params -ContentType "application/x-www-form-urlencoded"
- $result
New to ADSelfService Plus?