15 Replies Latest reply: Aug 15, 2017 8:07 PM by Peter Cammaert RSS

    Script Line Error. Can't find my mistake

    Max Christian Potass

      So I am currently trying to get following code working. When I execute it, I get a Script line Error. The code mentioned in the error starts at line 11. It probably is just a stupid mistage or misconseption as I am very new to this and have like no prgramming experience...

      It would be nice, if someone can help me.

      Let URL_Base='something';
      Let Timeout='something';
      Let URL_Open_1='something';
      Let URL_Open_2='something';
      Let URL_Intern_1='something';
      Let URL_Intern_2='something';
      Let URL_Extern_1='something';
      Let URL_Extern_2='something';
      
      
      For counter_1=0 to 2
        Let URL_1=$(URL_Base)&IF($(counter_1)=0,$(URL_Open_1),IF($(counter_1)=1,$(URL_Intern_1),$(URL_Extern_1)));
        Let URL_2=$(Timeout)&IF($(counter_1)=0,$(URL_Open_2),IF($(counter_2)=1,$(URL_Intern_2),$(URL_Extern_2)));
        For counter=0 to 14
        Let URL=$(URL_1)&($(counter)*1000)&$(URL_2);
        CUSTOM CONNECT TO $(URL);
        RestConnectorMasterTable:
        SQL SELECT
        "__KEY_root",
        (SELECT 
                  "key",
                    "__KEY_issues",
                  "__FK_issues",
                    (SELECT 
                          "created",
                          "__KEY_fields",
                          "__FK_fields",
                          (SELECT 
                          "@Value",
                              "__FK_customfield_10306"
                          FROM "customfield_10306" FK "__FK_customfield_10306" ArrayValueAlias "@Value"),
                          (SELECT 
                              "@Value" AS "@Value_u0",
                              "__FK_customfield_10305"
                          FROM "customfield_10305" FK "__FK_customfield_10305" ArrayValueAlias "@Value_u0")
                    FROM "fields" PK "__KEY_fields" FK "__FK_fields")
              FROM "issues" PK "__KEY_issues" FK "__FK_issues")
        FROM JSON (wrap on) "root" PK "__KEY_root"; 
        [customfield_10306]:
        LOAD   [@Value],
              [__FK_customfield_10306]&'.1' AS [__KEY_fields]
        RESIDENT RestConnectorMasterTable
        WHERE NOT IsNull([__FK_customfield_10306]);
        [customfield_10305]:
        LOAD   [@Value_u0],
              [__FK_customfield_10305]&'.1' AS [__KEY_fields]
        RESIDENT RestConnectorMasterTable
        WHERE NOT IsNull([__FK_customfield_10305]);
        [fields]:
        LOAD [created],
              [__KEY_fields]&'.1' as [__KEY_fields],
              [__FK_fields]&'.1' AS [__KEY_issues]
        RESIDENT RestConnectorMasterTable;
        [issues]:
        LOAD   [key],
              [__KEY_issues]&'.1' as [__KEY_issues]
        RESIDENT RestConnectorMasterTable;
      
        Drop Tables [RestConnectorMasterTable];
        Let counter=$(counter)+1;
        next
      Set counter=0;
      Let SLA=If($(counter_1)=0,'open',If($(counter_1)=1,'intern','extern'));
      STORE [customfield_10306] INTO customfield_10306_$(SLA).qvd (qvd);
      STORE [customfield_10305] INTO customfield_10305_$(SLA).qvd (qvd);
      STORE [fields] INTO fields_$(SLA).qvd (qvd);
      STORE [issues] INTO issues_$(SLA).qva