Any ways to mark request as failed

I’m currently in the AD connector rule for afterCreate and afterModify. If the transaction fails, I need to acknowledge to IDN that it was unsuccessful and mark the request as failed instead of successful.

Is there an API to mark requests has failed or a way to acknowledge IDN about exceptions?

I haven’t tested this but you can give it a try :

$sResult = New-Object System.IO.StringReader([System.String]$env:Result);
$xmlReader_Result = [System.xml.XmlTextReader]([sailpoint.utils.xml.XmlUtil]::getReader($sResult));
$resultObject = New-Object Sailpoint.Utils.objects.ServiceResult($xmlReader_Result);

if($resultObject.Errors.count -eq 0)
{
    $resultObject.Messages.add("Success!");
}
else
{
    $ErrorMessage = $_.Exception.Message 
    $ErrorItem = $_.Exception.ItemName
    $resultObject.Messages.add("Error!");
    $resultObject.Errors.add($ErrorMessage);
}

$resulttAsString = $env:Result
LogToFile("Result as XML object is: $resulttAsString")
2 Likes

As @sharvari pointed out, you don’t need an API, you are able to modify the result set. There is more detailed information in the IQService admin guide,. https://community.sailpoint.com/t5/IdentityNow-Connectors/IdentityNow-IQService-Administrator-s-Guide-vJune-2021/ta-p/77773

Thanks, @sharvari and @ruben_elizondo I will give it a try.

I have an additional script file in IQServer that is invoked inside the connector rule with the Invoke-Expression cmdlet. Although this cmdlet does not return the exception message, there are methods to capture the lastExitCode in PowerShell. In general, my main concern was locating $resultObject.Messages.add("Error!"); as it holds more significance, I can play with other things now. Thanks!. I

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.