{
  "key": "jira-helios-integration",
  "baseUrl": "https://jira.pbt-works.com",
  "apiMigrations": {
    "signed-install": true
  },
  "name": "Jira Helios Integration",
  "vendor": {
    "name": "Morosystems, s.r.o.",
    "url": "https://www.morosystems.cz/"
  },
  "authentication": {
    "type": "jwt"
  },
  "lifecycle": {
    "installed": "/installed",
    "uninstalled": "/uninstalled"
  },
  "scopes": [
    "READ",
    "WRITE",
    "ACT_AS_USER"
  ],
  "modules": {
    "jiraWorkflowPostFunctions": [
      {
        "key": "workflow-post-function-create-offer-from-commission",
        "name": {
          "value": "Create offer header in Helios for every commission"
        },
        "description": {
          "value": "Creates offer header in Helios for every commission associated with issue"
        },
        "view": {
          "url": "/post-functions/create-offer-from-commission/view?id={postFunction.id}&config={postFunction.config}"
        },
        "edit": {
          "url": "/post-functions/create-offer-from-commission/edit?id={postFunction.id}&config={postFunction.config}"
        },
        "create": {
          "url": "/post-functions/create-offer-from-commission/create"
        },
        "triggered": {
          "url": "/post-functions/create-offer-from-commission/triggered"
        }
      },
      {
        "key": "workflow-post-function-create-offer",
        "name": {
          "value": "Create offer header in Helios"
        },
        "description": {
          "value": "Creates offer header in Helios"
        },
        "view": {
          "url": "/post-functions/create-offer/view?id={postFunction.id}&config={postFunction.config}"
        },
        "edit": {
          "url": "/post-functions/create-offer/edit?id={postFunction.id}&config={postFunction.config}"
        },
        "create": {
          "url": "/post-functions/create-offer/create"
        },
        "triggered": {
          "url": "/post-functions/create-offer/triggered"
        }
      }
    ],
    "webItems": [
      {
        "key": "create-sharepoint-folder2",
        "location": "jira.issue.tools",
        "weight": 10,
        "name": {
          "value": "Create Sharepoint Folder"
        },
        "target": {
          "type": "dialog",
          "options": {
            "height": "200px",
            "width": "600px"
          }
        },
        "url": "/sharepoint/view",
        "context": "addon",
        "conditions": [
          {
            "or": [
              {
                "condition": "jira_expression",
                "params": {
                  "expression": "(issue.customfield_10156 ?? '').length == 0"
                }
              },
              {
                "and": [
                  {
                    "condition": "jira_expression",
                    "params": {
                      "expression": "issue.project.key == 'OP'"
                    }
                  },
                  {
                    "condition": "jira_expression",
                    "params": {
                      "expression": "(issue.customfield_10171 ?? '').length == 0"
                    }
                  }
                ]
              }
            ]
          },
          {
            "or":  [
              {
                "condition": "jira_expression",
                "params": {
                  "expression": "['DS', 'MK', 'TR', 'EK', 'OT', 'ST', 'VR', 'PR', 'OP'].includes(issue.project.key)"
                }
              },
              {
                "condition": "jira_expression",
                "params": {
                  "expression": "issue.project.projectCategory.name == 'Vývoj a konstrukce'"
                }
              }
            ]
          }
        ]
      }
    ]
  }
}
