NTP-44973 | Return default Houston team when reporting team is inactive (#483)

* NTP-44973 | Return default Houston team when reporting team is found inactive.

* NTP-44973 | Changing defaultTeamId from constant to env_var.
This commit is contained in:
Amitesh Vijaykumar Magar
2025-03-05 16:30:40 +05:30
committed by GitHub
parent 36d07c7ce2
commit 5ed80d4516
2 changed files with 8 additions and 2 deletions

View File

@@ -92,6 +92,8 @@ navi.jira.base.url=https://navihq.atlassian.net/browse/
houston.channel.help.message=/houston: General command to open the other options| /houston severity: Opens the view to update severity of the incident| /houston set severity to <severities_label>: Sets the incident severity| /houston team: Opens the view to update team| /houston status: Opens the view to set status| /houston set status to <Investigating/Identified/Monitoring/Resolved>: Sets the incident status| /houston description: Opens the view to set incident description| /houston set description to <incident description>: Sets the incident description| /houston resolve: Opens the view to fill RCA and resolve| /houston rca: Opens the view to fill RCA houston.channel.help.message=/houston: General command to open the other options| /houston severity: Opens the view to update severity of the incident| /houston set severity to <severities_label>: Sets the incident severity| /houston team: Opens the view to update team| /houston status: Opens the view to set status| /houston set status to <Investigating/Identified/Monitoring/Resolved>: Sets the incident status| /houston description: Opens the view to set incident description| /houston set description to <incident description>: Sets the incident description| /houston resolve: Opens the view to fill RCA and resolve| /houston rca: Opens the view to fill RCA
non.houston.channel.help.message=/houston: General command to open the other options| /houston start: Opens the view to start a new incident non.houston.channel.help.message=/houston: General command to open the other options| /houston start: Opens the view to start a new incident
houston.default.team.id=HOUSTON_DEFAULT_TEAM_ID
jira.base.url=JIRA_BASE_URL jira.base.url=JIRA_BASE_URL
jira.username=JIRA_USERNAME jira.username=JIRA_USERNAME
jira.api.token=JIRA_API_TOKEN jira.api.token=JIRA_API_TOKEN

View File

@@ -237,8 +237,12 @@ func (i *incidentService) GetIncidentResponseFromIncidentEntity(
if incidents[incidentIndex].ReportingTeamId != nil { if incidents[incidentIndex].ReportingTeamId != nil {
reportingTeamEntity, err := i.teamService.GetTeamById(*incidents[incidentIndex].ReportingTeamId) reportingTeamEntity, err := i.teamService.GetTeamById(*incidents[incidentIndex].ReportingTeamId)
if err != nil { if err != nil {
logger.Error("error in fetching reporting team", zap.Error(err)) logger.Warn("error in fetching reporting team, returning default team")
return nil, err reportingTeamEntity, err = i.teamService.GetTeamById(viper.GetUint("houston.default.team.id"))
if err != nil {
logger.Error("error in fetching default team", zap.Error(err))
return nil, err
}
} }
reportingTeamResponse = teamDTOToIncidentHeaderOption(reportingTeamEntity.ToDTO()) reportingTeamResponse = teamDTOToIncidentHeaderOption(reportingTeamEntity.ToDTO())
} }