override fun fillModel()

in src/main/kotlin/jetbrains/buildServer/notification/slackNotifier/healthReport/SlackInvalidBuildFeatureExtension.kt [51:71]


    override fun fillModel(model: MutableMap<String, Any>, request: HttpServletRequest) {
        super.fillModel(model, request)
        val statusItem = getStatusItem(request)
        val data = statusItem.additionalData
        model["reason"] = data["reason"] as String
        model["feature"] = data["feature"] as SBuildFeatureDescriptor

        val type = data["type"] as String
        val id = data["buildTypeId"] as String
        if (type == "buildType") {
            model["editUrl"] = webLinks.getEditConfigurationPageUrl(id)
            val buildType = projectManager.findBuildTypeByExternalId(id)
                ?: throw BuildTypeNotFoundException("Can't find build type with external id '${id}'")
            model["buildTypeName"] = buildType.fullName
        } else {
            model["editUrl"] = webLinks.getEditTemplatePageUrl(id)
            val template = projectManager.findBuildTypeTemplateByExternalId(id)
                ?: throw BuildTypeNotFoundException("Can't find build template type with external id '${id}'")
            model["buildTypeName"] = template.fullName
        }
    }