Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW

Qlik Sense QRS API: Create a task triggered after another task (PowerShell)

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Damien_Villaret
Support
Support

Qlik Sense QRS API: Create a task triggered after another task (PowerShell)

Last Update:

Apr 25, 2023 4:50:07 AM

Updated By:

Sonja_Bauernfeind

Created date:

Jun 9, 2020 6:00:53 PM

This is a sample to create a task triggered after another one with Qlik Sense Repository API.

This example is provided as is. Further questions should be directed to the Qlik Sense API and Integration forums


Sample

$body = '{     
  "task":
{"app": {      
  "id": "7c72cb1c-63de-4246-9e3b-55de2202f0bb"    },  
  "name": "My New Task"    },  
   "compositeEvents": [ {         
       "timeConstraint":{   
       "days":0,                 
       "hours":0,                 
       "minutes":360,            
       "seconds":0    
},     
"compositeRules":[    {     
             "reloadTask":{       
              "id": "da5da832-82cc-4e09-bf6d-adb2f75c797c"    
       },       
       "ruleState":1      
  }       ],  
  "name":"Trigger (successful) from depending Task",
  "enabled": true, 
  "eventType": 1     }]  
  }'
   $hdrs = @{}
   $hdrs.Add("X-Qlik-xrfkey","iX83QmNlvu87yyAB")
   $hdrs.Add("X-Qlik-User","UserDirectory=internal;UserId=sa_repository")
   $url = "https://qlikserver1.domain.local:4242/qrs/ReloadTask/create?xrfkey=iX83QmNlvu87yyAB"
   $cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
   Invoke-RestMethod -Uri $url -Method Post -Body $body -ContentType 'application/json' -Headers $hdrs -Certificate $cert


In the above sample, 7c72cb1c-63de-4246-9e3b-55de2202f0bb is the app ID of the app to reload, and da5da832-82cc-4e09-bf6d-adb2f75c797c is the task ID after which this reload task will be triggered.

Labels (1)
Comments
earbole
Contributor II
Contributor II

Thanks, just want I need it. !

sai_09
Contributor
Contributor

Does it worked?

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @sai_09 

We can confirm that the methods in this article are still valid.

If you require assistance implementing the example, I recommend posting in our Qlik Sense API and Integration forums.

All the best,
Sonja 

Contributors
Version history
Last update:
‎2023-04-25 04:50 AM
Updated by: