is there a way target the identity tasks and force complete it. Background tasks are preventing updates to identity profile. I am trying to update the priority on idp.
Hi @nikeshpark29,
you can get the list of pending task in your tenant using api.
https://sailpoint.api.identitynow.com/beta/task-status/pending-tasks
Once you get the list job, you can update the job staus to complete using below api and body.
https://sailpoint.api.identitynow.com/beta/task-status/123486hksbfugadf
Body:
{
“
op”: “replace”,
“path”: “ /completed”,“
value”: “2024 - 08 - 16 T00: 00: 00 Z”
}, {
“
op”: “replace”,
“path”: “ /completionStatus”,“
value”: “Success”
}
Regards,
Arun
Hi Arun,
even when i assign offest=1500, api returns list of pending tasks.
so there are thousands of them
Goto Monitor and see if any jobs are in the que then goto pending task api and search for jobs. Grab the id of the job you want to complete and send out the api and script. That should stop the pending task and you should be good to go.
Good answers above, another thing to keep in mind if you continually see this kind of message is you may have a stuck task, in that case it’s a good idea to reach out to support.
I use a script like the following:
Param(
[Parameter(Mandatory = $true)]
[String]$configPath,
[Parameter()]
[Switch]$exportOnly
)
$configObject = Get-Content -Raw -Path $configPath | ConvertFrom-Json
$tokenURI = "$($configObject.v2URI)/oauth/token?grant_type=client_credentials&client_id=$($configObject.personalId)&client_secret=$($configObject.personalSecret)"
$token = Invoke-RestMethod -Method POST -Uri $tokenURI
function Get-PendingTasks () {
$pageSize = 250
$currentCount=0
Do {
Write-Host "$($configObject.v2URI)/beta/task-status/pending-tasks/?limit=$($pageSize)&offset=$($currentCount)"
$resp = Invoke-RestMethod -Method GET -Uri "$($configObject.v2URI)/beta/task-status/pending-tasks?limit=$($pageSize)&offset=$($currentCount)" -Headers @{Authorization = "Bearer $($token.access_token)"}
$currentCount = $currentCount + $resp.Count
$respList = $respList + $resp
Write-Host $currentCount
Write-Host "$($resp.Count)"
}
While ($resp.Count -eq $pageSize)
return $respList
}
if ($token ) {
$taskList = Get-PendingTasks
$provisioningTasks = $taskList | WHERE-OBJECT {$_.uniqueName -like "Cloud Access Request Provisioning*"}
$provisioningTasks | Export-CSV -NoTypeInformation -Path ".\provisioningTasks.csv"
$taskList = $taskList | WHERE-OBJECT {$_.uniqueName -notlike "Cloud Access Request Provisioning*"}
$taskList | Export-CSV -NoTypeInformation -Path ".\PendingTasks.csv"
$today = Get-Date -Format "o"
if (!$exportOnly) {
$taskList | forEach {
$taskId = $_.id
$patchURI = "$($configObject.v2URI)/beta/task-status/$($taskId)"
$updateList = New-Object System.Collections.ArrayList
$statusUpdateObj = [PSCustomObject]@{
op = "replace"
path = "/completionStatus"
value = "Success"
}
$updateList.Add($statusUpdateObj) > $null
$dateUpdateObj = [PSCustomObject]@{
op = "replace"
path = "/completed"
value = "$($today)"
}
$updateList.Add($dateUpdateObj) > $null
$updateJSON = ConvertTo-Json @($updateList) -Depth 8 -Compress
Invoke-RestMethod -Method PATCH -Uri $patchURI -Headers @{Authorization = "Bearer $($token.access_token)";"ContentType" = "application/json-patch+json"} -Body $updateJSON -ContentType "application/json-patch+json"
}
}
}
This script gets all pending tasks, eliminates anything with a name that includes “Cloud Access Request Provisioning” (not that I know it will cause any issues - it just scared me to kill those tasks), then marks the rest complete.
The “configFile” that it takes in as a parameter is a json file with connection information - not super-secure, but functional. it looks like the following:
{
"v2URI": "https://instance.api.identitynow.com",
"personalId": "123cee3936ae4d76a6a38360417a1dc31",
"personalSecret": "a84e5d1545ab0f90e2a85349ad25a8eeed9002f3e9d139a5751c5c50acb3cc84a"
}
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.