Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vish123
Creator III
Creator III

Task status using QRS API

Hi Team,

I am triggering QlikSense task using QRS API using powershell and it's working fine but I want to print task status as well but I don't see any end point. Can anyone tried ? 

Labels (1)
1 Solution

Accepted Solutions
vish123
Creator III
Creator III
Author

Hi Yko,

Thanks for your reply.

I have resolved the issue myself. Below is the code to check task status.

 

$url2 = "https://$($DNSName):4242/qrs/reloadtask/$($t_id)?xrfkey=12345678qwertyui"

        $taskstatus = $(Invoke-RestMethod -Uri $url2 -Method Get -Headers $hdrs -Certificate $cert)
        
      if  ($($taskstatus).operational.lastExecutionResult.status -eq 7 -or $($taskstatus).operational.lastExecutionResult.status -eq 8)
      
      $status = $($taskstatus).operational.lastExecutionResult.status 
 
which also helps others.

View solution in original post

3 Replies
Øystein_Kolsrud
Employee
Employee

I believe you'll find the information you are looking for under the property "operational" when you call "GET /qrs/reloadtask/{taskId}":

https://help.qlik.com/en-US/sense-developer/February2021/APIs/RepositoryServiceAPI/index.html?page=4...

vish123
Creator III
Creator III
Author

Hi Yko,

Thanks for your reply.

I have resolved the issue myself. Below is the code to check task status.

 

$url2 = "https://$($DNSName):4242/qrs/reloadtask/$($t_id)?xrfkey=12345678qwertyui"

        $taskstatus = $(Invoke-RestMethod -Uri $url2 -Method Get -Headers $hdrs -Certificate $cert)
        
      if  ($($taskstatus).operational.lastExecutionResult.status -eq 7 -or $($taskstatus).operational.lastExecutionResult.status -eq 8)
      
      $status = $($taskstatus).operational.lastExecutionResult.status 
 
which also helps others.
generalfinance
Contributor III
Contributor III

Hi Yko,

I'm trying your script, but it gives me an error right after the if:
At C: \ Users \ adminmm \ Desktop \ QMS API with PowerShell.ps1: 5 char: 135
+ ... lt.status -eq 😎
+ ~
Missing statement block after if (condition).
+ CategoryInfo: ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId: MissingStatementBlock

Thanks