<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Deleting/updating a task trigger in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Deleting-updating-a-task-trigger/m-p/2033075#M18034</link>
    <description>&lt;P&gt;The Following PowerShell Function is built using &lt;A href="https://github.com/QlikProfessionalServices/QlikSenseCLI" target="_blank" rel="noopener"&gt;QlikSenseCLI&lt;/A&gt;&amp;nbsp;(not the same as the Qlik-CLI-Windows)&lt;/P&gt;
&lt;P&gt;The function requires a SourceAppID and a DestinationAppID and will copy all reaload tasks &amp;amp; triggers from one app to another&lt;/P&gt;
&lt;P&gt;From this function you would be able to see that we can call the function (&lt;SPAN class="pl-c1"&gt;Get-QSSchemaevent&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Full &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Filter &lt;/SPAN&gt;&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;ReloadTask.id eq &lt;SPAN class="pl-k"&gt;&lt;SPAN class="pl-pse"&gt;$&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="pl-pse"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pl-smi"&gt;$ReloadTask.Id&lt;/SPAN&gt;&lt;SPAN class="pl-pse"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pl-pds"&gt;") to get the "Triggers" for the reload tasks.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;(Update-QSSchemaEvent) can be used to update modified triggers.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;##Update Trigger
$SchemaEvent = Get-QSSchemaevent -Id f8bf1d52-d17e-4a54-9b29-c5c3ab67714e
#Modify the Event as required
$SchemaEvent.Name = "Updated_$($SchemaEvent.Name)"
$SchemaEvent.Enabled = $false
Update-QSSchemaevent -Id $SchemaEvent.Id -SchemaEventObj $SchemaEvent&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;function Copy-QSReloadTasks {
	param
	(
		[Parameter(Mandatory = $true)]
		$SourceAppID,
		[Parameter(Mandatory = $true)]
		$DestinationAppID
	)
	
	#Get the Condensed Verion of the Reload Task
	$AppReloadTasks = Get-QSReloadtask -Filter "App.id eq $($SourceAppID)"
	foreach ($ReloadTask in $AppReloadTasks) {
		#Get the full version
		$ReloadTaskFull = Get-QSReloadtask -Id $ReloadTask.Id
		
		#Get the Schema Events for the Reload Task
		$SchemaEvents = Get-QSSchemaevent -Full -Filter "ReloadTask.id eq $($ReloadTask.Id)"
		
		#Get Destination App Condensed, Filter alway returns a Array so select first
		$DestinationApp = $(Get-QSApp -Filter "id eq $($DestinationAppID)") | Select-Object -First 1
		
		#Create a New Reload task, clearing the ID,Operational and relacing the App
		## You can further manipulate the Name etc here if needed.
		$NewRT = New-QSReloadTask -InputObject $ReloadTaskFull -Id ([guid]::Empty) -App $DestinationApp -Operational $Null
		
		#Add the New reload task to QlikSense
		$DestRTFull = Add-QSReloadtask -ReloadTaskObj $NewRT
		
		#Get New ReloadTask Condensed, Filter alway returns a Array so select first
		$DestRT = $(Get-QSReloadtask -Filter "id eq $($DestRTFull.id)") | Select-Object -First 1
		
		foreach ($Event in $SchemaEvents) {
			#Create a New Schema Event, clearing the ID,Operational and relacing the ReloadTask
			## You can further manipulate the Name etc here if needed.
			$NewQSSchemaEvent = New-QSSchemaEvent -InputObject $Event -Id ([guid]::Empty) -Operational $null -ReloadTask $DestRT
			
			#Add the schema event to the reload task
			$QSSchemaEvent = Add-QSSchemaevent -SchemaEventObj $NewQSSchemaEvent
		}
	}
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this can then be called like to, where we call the function and supply the required ID's&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Connect-QlikSense -TrustAllCertificates
Copy-QSReloadTasks -SourceAppID b73ad8a5-ad67-4778-b350-8151976895bf -DestinationAppID ac2a350a-b54e-460f-9c67-c0d4eb5bea73
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or like so, where we use a UI to select the Source and Destination Apps from a grid view and pass the IDs to the function&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Connect-QlikSense -TrustAllCertificates
$Apps = Get-QSApp
#create a formattedlist to make the UI a little more readable
$FormattedApplist = $($Apps|Select-Object -Property Name,ID,@{Name="Stream";e={$_.Stream.Name}})
$SelectedApp = $FormattedApplist|Out-GridView -OutputMode Single -Title "Copy Reload Tasks from"
$DestinationApp = $FormattedApplist|Out-GridView -OutputMode Single -Title "Copy Reload Tasks to"
Copy-QSReloadTasks -SourceAppID $SelectedApp.Id -DestinationAppID $DestinationApp.Id&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2023 02:08:50 GMT</pubDate>
    <dc:creator>Marc</dc:creator>
    <dc:date>2023-02-02T02:08:50Z</dc:date>
    <item>
      <title>Deleting/updating a task trigger</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Deleting-updating-a-task-trigger/m-p/2027203#M17958</link>
      <description>&lt;P&gt;I use Qlik CLI to duplicate apps, publish and create tasks. This is all going well. However, I now need to adjust reload tasks. The apps first had to be reloaded after app A was successfully completed. Now the apps need to be reloaded after app B is finished successfully.&lt;/P&gt;
&lt;P&gt;In the Qlik CLI package I can only find the command "Add-QlikTrigger". I don't see any commands like "Get-QlikTrigger", "Remove-QlikTrigger" or "Update-QlikTrigger".&lt;/P&gt;
&lt;P&gt;Do I have to delete and recreate the entire task and then provide it with the desired trigger?&lt;/P&gt;
&lt;P&gt;For example this task :&lt;/P&gt;
&lt;PRE&gt;Get-QlikReloadTask -Id 87a8cfe5-cc28-4035-8a3f-bd0277523866 -raw&lt;/PRE&gt;
&lt;PRE&gt;id : 87a8cfe5-cc28-4035-8a3f-bd0277523866&lt;BR /&gt;createdDate : 2022-04-11T12:28:25.777Z&lt;BR /&gt;modifiedDate : 2022-11-23T08:24:04.759Z&lt;BR /&gt;modifiedByUserName : XXX&lt;BR /&gt;customProperties : {}&lt;BR /&gt;app : @{id=5b58c51d-e23a-4f6d-aa16-1c62136ad661; name=Commission Statement; appId=; publishTime=2023-01-17T20:00:56.931Z; &lt;BR /&gt;published=True; stream=; savedInProductVersion=12.1219.3; migrationHash=21ecc792c56e18162f1785d3d41f28fdaced5c96; availabilityStatus=0; privileges=}&lt;BR /&gt;isManuallyTriggered : False&lt;BR /&gt;operational : @{id=482640a1-2bd7-49f5-af0a-5a62f3a81a2f; lastExecutionResult=; nextExecution=1753-01-01T00:00:00.000Z; privileges=}&lt;BR /&gt;isPartialReload : False&lt;BR /&gt;name : Automated reload of app Commission Statement&lt;BR /&gt;taskType : 0&lt;BR /&gt;enabled : True&lt;BR /&gt;taskSessionTimeout : 30&lt;BR /&gt;maxRetries : 0&lt;BR /&gt;tags : {@{id=6a516ce1-7279-467d-82f7-bd9afda95dfd; name=Sales; privileges=}}&lt;BR /&gt;privileges : &lt;BR /&gt;schemaPath : ReloadTask&lt;/PRE&gt;
&lt;P&gt;How can I retrieve and manage the active trigger of this task?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 13:56:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Deleting-updating-a-task-trigger/m-p/2027203#M17958</guid>
      <dc:creator>gardenierbi</dc:creator>
      <dc:date>2023-01-18T13:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting/updating a task trigger</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Deleting-updating-a-task-trigger/m-p/2033075#M18034</link>
      <description>&lt;P&gt;The Following PowerShell Function is built using &lt;A href="https://github.com/QlikProfessionalServices/QlikSenseCLI" target="_blank" rel="noopener"&gt;QlikSenseCLI&lt;/A&gt;&amp;nbsp;(not the same as the Qlik-CLI-Windows)&lt;/P&gt;
&lt;P&gt;The function requires a SourceAppID and a DestinationAppID and will copy all reaload tasks &amp;amp; triggers from one app to another&lt;/P&gt;
&lt;P&gt;From this function you would be able to see that we can call the function (&lt;SPAN class="pl-c1"&gt;Get-QSSchemaevent&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Full &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Filter &lt;/SPAN&gt;&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;ReloadTask.id eq &lt;SPAN class="pl-k"&gt;&lt;SPAN class="pl-pse"&gt;$&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="pl-pse"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pl-smi"&gt;$ReloadTask.Id&lt;/SPAN&gt;&lt;SPAN class="pl-pse"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pl-pds"&gt;") to get the "Triggers" for the reload tasks.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;(Update-QSSchemaEvent) can be used to update modified triggers.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;##Update Trigger
$SchemaEvent = Get-QSSchemaevent -Id f8bf1d52-d17e-4a54-9b29-c5c3ab67714e
#Modify the Event as required
$SchemaEvent.Name = "Updated_$($SchemaEvent.Name)"
$SchemaEvent.Enabled = $false
Update-QSSchemaevent -Id $SchemaEvent.Id -SchemaEventObj $SchemaEvent&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;function Copy-QSReloadTasks {
	param
	(
		[Parameter(Mandatory = $true)]
		$SourceAppID,
		[Parameter(Mandatory = $true)]
		$DestinationAppID
	)
	
	#Get the Condensed Verion of the Reload Task
	$AppReloadTasks = Get-QSReloadtask -Filter "App.id eq $($SourceAppID)"
	foreach ($ReloadTask in $AppReloadTasks) {
		#Get the full version
		$ReloadTaskFull = Get-QSReloadtask -Id $ReloadTask.Id
		
		#Get the Schema Events for the Reload Task
		$SchemaEvents = Get-QSSchemaevent -Full -Filter "ReloadTask.id eq $($ReloadTask.Id)"
		
		#Get Destination App Condensed, Filter alway returns a Array so select first
		$DestinationApp = $(Get-QSApp -Filter "id eq $($DestinationAppID)") | Select-Object -First 1
		
		#Create a New Reload task, clearing the ID,Operational and relacing the App
		## You can further manipulate the Name etc here if needed.
		$NewRT = New-QSReloadTask -InputObject $ReloadTaskFull -Id ([guid]::Empty) -App $DestinationApp -Operational $Null
		
		#Add the New reload task to QlikSense
		$DestRTFull = Add-QSReloadtask -ReloadTaskObj $NewRT
		
		#Get New ReloadTask Condensed, Filter alway returns a Array so select first
		$DestRT = $(Get-QSReloadtask -Filter "id eq $($DestRTFull.id)") | Select-Object -First 1
		
		foreach ($Event in $SchemaEvents) {
			#Create a New Schema Event, clearing the ID,Operational and relacing the ReloadTask
			## You can further manipulate the Name etc here if needed.
			$NewQSSchemaEvent = New-QSSchemaEvent -InputObject $Event -Id ([guid]::Empty) -Operational $null -ReloadTask $DestRT
			
			#Add the schema event to the reload task
			$QSSchemaEvent = Add-QSSchemaevent -SchemaEventObj $NewQSSchemaEvent
		}
	}
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this can then be called like to, where we call the function and supply the required ID's&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Connect-QlikSense -TrustAllCertificates
Copy-QSReloadTasks -SourceAppID b73ad8a5-ad67-4778-b350-8151976895bf -DestinationAppID ac2a350a-b54e-460f-9c67-c0d4eb5bea73
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or like so, where we use a UI to select the Source and Destination Apps from a grid view and pass the IDs to the function&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Connect-QlikSense -TrustAllCertificates
$Apps = Get-QSApp
#create a formattedlist to make the UI a little more readable
$FormattedApplist = $($Apps|Select-Object -Property Name,ID,@{Name="Stream";e={$_.Stream.Name}})
$SelectedApp = $FormattedApplist|Out-GridView -OutputMode Single -Title "Copy Reload Tasks from"
$DestinationApp = $FormattedApplist|Out-GridView -OutputMode Single -Title "Copy Reload Tasks to"
Copy-QSReloadTasks -SourceAppID $SelectedApp.Id -DestinationAppID $DestinationApp.Id&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 02:08:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Deleting-updating-a-task-trigger/m-p/2033075#M18034</guid>
      <dc:creator>Marc</dc:creator>
      <dc:date>2023-02-02T02:08:50Z</dc:date>
    </item>
  </channel>
</rss>

