Multiple Workflow Validator

Is it possible to create multiple workflow validators with Forge modules?

This is my manifest.yml and it is giving me error if i add more than one validator.

modules:

jira:workflowValidator:

- key: validator

  expression: issue.assignee != user

  name: validator

  description: validator

jira:workflowValidator:

- key: validator-two

  name: validator-two

  description: validator-two

  expression: issue.assignee == user

  errorMessage: "The transition failed"  

function:

- key: main

  handler: index.run

app:

id: ari:cloud:ecosystem::app/a7cbb9ac-d3c2-434f-a263-41412e0dbda4

name: validator

Error:

7:-194  error    manifest.yml failed to parse content - duplicated mapping key  valid-yaml-required
Error: Command failed due to validation error.

Hi @OdinSon, you should declare multiple modules of the same type under the module type, i.e. just under the jira:workflowValidator:

  jira:workflowValidator:
    - key: validator
      expression: issue.assignee != user
      name: validator
      description: validator
    - key: validator-two
      name: validator-two
      description: validator-two
      expression: issue.assignee == user
      errorMessage: "The transition failed"  
1 Like