Which IIQ version are you inquiring about?
8.3
Share all details about your problem, including any error messages you may have received.
Is there a way to trigger a task using the IIQ rest API?
8.3
Is there a way to trigger a task using the IIQ rest API?
Hi @liza_s
You can use the below API to launch the workflow and then you can write the code to execute the task from workflow.
https://host/identityiq/scim/v2/LaunchedWorkflows
body format :
{
"schemas": [
"urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow",
"urn:ietf:params:scim:schemas:sailpoint:1.0:TaskResult"
],
"urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow": {
"workflowName": "Workflow Name",
"input": [
{
"key": "Test1",
"value": "Test"
},
{
"key": "Test2",
"value": "Test"
}
]
}
}
For more detail understanding please go through this launch-workflow | SailPoint Developer Community
Regards
Ankush
Hi @liza_s ,
You can utilize the Launch Workflow API to trigger the task.
Start by creating a workflow and include a step that initiates the task execution.
Please refer the workflow step
<Step name="Run Test Application Account Aggregation">
<Script>
<Source><![CDATA[
import sailpoint.api.TaskManager;
import sailpoint.object.Attributes;
import sailpoint.object.Identity;
import sailpoint.tools.GeneralException;
try {
Attributes newArgs = new Attributes();
newArgs.put("correlateEntitlements", "true");
newArgs.put("applications", "Test Application");
newArgs.put("taskCompletionEmailNotify", "Disabled");
TaskManager taskMan = new TaskManager(context);
taskMan.runSync("Account Aggregation", newArgs);
} catch (Exception e) {
throw new GeneralException(e);
}
]]></Source>
</Script>
<Transition to="Next Step"/>
</Step>