Qlik-Cli-Windows icon indicating copy to clipboard operation
Qlik-Cli-Windows copied to clipboard

Add 2 tag on a reload task

Open Keto34 opened this issue 3 years ago • 3 comments

Hi I hope you're fine :) !

I am using Qlik Cli and I cannot add 2 tags to my reload task, I have a 400 "incorrect request" error when I try. But I don't have this error when I add a single tag ...

Here is my code :

$Task = Get-QlikReloadTask -filter "name eq '$myTaskName'" $Task | Update-QlikReloadTask -tags $TagName, $TagNameBis

I also tried on two lines but same result ...

$Task = Get-QlikReloadTask -filter "name eq '$myTaskName'" $Task | Update-QlikReloadTask -tags $TagName $Task | Update-QlikReloadTask -tags $TagNameBis

Hoping to have an answer, thank you for your help :)

Keto34 avatar Jul 29 '21 13:07 Keto34

If you run the Update command multiple times it will replace the tags each time so you will end up with only the last tag applied. Since you are still getting an error when assigning only the second tag it is likely there is a problem with that tag.

Have you created the tag? Tags can only be assigned if they have already been created.

Try adding the -Verbose switch to the Update command to check the JSON being sent to the API, and please share it here.

What version of Qlik-Cli are you using? Check by running Get-Module -ListAvailable Qlik-Cli

ahaydon avatar Aug 04 '21 09:08 ahaydon

Please find below attached snap which will help you with

  • Create New-QlikTag
  • Check the availabel QlikTag
  • Update multiple tags in reload task image

I hope this will help you.

satish3922 avatar Aug 07 '21 12:08 satish3922

I tried the same command that you describe and it correctly assigns both tags, see below output.

Please can you provide the output from the UpdateQlikReloadTask command when run with the -Verbose switch. e.g. Update-QlikReloadTask -tags Satish,TestingTag -id $task_id -Verbose

[localhost]: PS C:\Users\vagrant\Documents> New-QlikTag -name TestingTag


id                 : e958b443-a059-4a41-9580-4303b5439ee4
createdDate        : 2021/08/24 15:41
modifiedDate       : 2021/08/24 15:41
modifiedByUserName : SENSE-CN\vagrant
name               : TestingTag
privileges         :
schemaPath         : Tag



[localhost]: PS C:\Users\vagrant\Documents> New-QlikTag -name Satish


id                 : 0f413c06-5662-4159-8480-2ac13889013f
createdDate        : 2021/08/24 15:42
modifiedDate       : 2021/08/24 15:42
modifiedByUserName : SENSE-CN\vagrant
name               : Satish
privileges         :
schemaPath         : Tag



[localhost]: PS C:\Users\vagrant\Documents> Update-QlikReloadTask -tags Satish,TestingTag -id $task_id


id                  : 58f6fe53-9380-46b1-8e2c-4dfafc168042
createdDate         : 2021/08/24 15:38
modifiedDate        : 2021/08/24 15:42
modifiedByUserName  : SENSE-CN\vagrant
customProperties    : {}
app                 : @{id=ca86c34e-c63e-4888-bd82-da0ff620c779; name=Operations Monitor; appId=; publishTime=2021/08/24 12:25; published=True; stream=; savedInProductVersion=12.969.2;
                      migrationHash=21ecc792c56e18162f1785d3d41f28fdaced5c96; availabilityStatus=NotApplicable; privileges=}
isManuallyTriggered : False
operational         : @{id=1ef9e6a1-c12f-4925-9f33-97c6881504a2; lastExecutionResult=; nextExecution=1753/01/01 00:00; privileges=}
name                : Test1
taskType            : Reload
enabled             : True
taskSessionTimeout  : 1440
maxRetries          : 0
tags                : {@{id=0f413c06-5662-4159-8480-2ac13889013f; name=; privileges=}, @{id=e958b443-a059-4a41-9580-4303b5439ee4; name=; privileges=}}
privileges          :
schemaPath          : ReloadTask

ahaydon avatar Aug 24 '21 14:08 ahaydon