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:
committed by
GitHub
parent
36d07c7ce2
commit
5ed80d4516
@@ -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
|
||||
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.username=JIRA_USERNAME
|
||||
jira.api.token=JIRA_API_TOKEN
|
||||
|
||||
@@ -237,9 +237,13 @@ func (i *incidentService) GetIncidentResponseFromIncidentEntity(
|
||||
if incidents[incidentIndex].ReportingTeamId != nil {
|
||||
reportingTeamEntity, err := i.teamService.GetTeamById(*incidents[incidentIndex].ReportingTeamId)
|
||||
if err != nil {
|
||||
logger.Error("error in fetching reporting team", zap.Error(err))
|
||||
logger.Warn("error in fetching reporting team, returning default team")
|
||||
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())
|
||||
}
|
||||
incidentResponse.ReportingTeam = reportingTeamResponse
|
||||
|
||||
Reference in New Issue
Block a user