System test failing for Policy having variable definition outside Policy Templates

Hi Team!

I am working on one of the integrations in which I have defined one variable in the main manifest (package level) in such a fashion.

vars:
  - name: instance_url
    type: text
    title: Instance URL
    required: true
    show_user: true
  
policy_templates:
  - name: name
    title: name logs
    description: Collect logs from named instances.
    inputs:
      - type: httpjson
        title: Collect logs using REST API
        description: Collect logs from instances using REST API.

I used the following specs for the system test:

vars:
  instance_url: instance_url
input: httpjson
data_stream:
  vars:
    preserve_original_event: true

I tried the data collection with this manifest it's working fine for me, but the system test policy is not getting created. It gives me the following error.

Error: error running package system tests: could not complete test run: could not add data stream config to policy: could not add package to policy; API status code = 400; response body = {"statusCode":400,"error":"Bad Request","message":"Package policy is invalid: vars.instance_url: Instance URL is required"}

JFYI, after adding default value for the instance_url variable the system test ran fine, still thinking if there is any compulsion on adding default value, when defined variables in such manner?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.