ooiservices/app/main/notifications_redmine.py
def reissue_notification(alert, definition, notification):
    """ Create another (re-issue notification) as a part of esclation process (for alerts only)
    """
    result = None
    try:
        ticket_id = 0

        # If red mine enabled:
        if notification.use_redmine:
            ticket_id = reissue_notification_redmine(alert, definition, notification)
            if ticket_id is None:
                message = 'Failed to reissue (create another new)_redmine_ticket.'
                current_app.logger.info('[reissue_notification] %s ' % message)
                return result
            # Prepare base exception message for update when using redmine for notification
            exception_message = 'Reissued redmine ticket (id:%d) but failed to update_alert_alarm_escalation; ' % ticket_id
        else:
            # Prepare base exception message for update when NOT using redmine for notification
            exception_message = 'Reissued notification but failed to update_alert_alarm_escalation; '

        # update escalate fields
        escalated = True
        ts_escalated = dt.datetime.strftime(dt.datetime.now(), "%Y-%m-%dT%H:%M:%S")
        try:
            SystemEvent.update_alert_alarm_escalation(id=alert.id, ticket_id=ticket_id,
                                                  escalated=escalated, ts_escalated=ts_escalated)
        except Exception as err:
            message = exception_message + str(err.message)
            current_app.logger.info('[reissue_notification] %s ' % message)
            return result

        result = ticket_id

    except Exception as err:
        current_app.logger.info('[reissue_notification] %s ' % err.message)
    finally:
        return result
 Create another (re-issue notification) as a part of esclation process (for alerts only)
    
Create another (re-issue notification) as a part of esclation process (for alerts only)
Create another ( re - issue notification ) as a part of esclation process ( for alerts only )
def reissue_notification(alert, definition, notification):
    result = None
    try:
        ticket_id = 0
        if notification.use_redmine:
            ticket_id = reissue_notification_redmine(alert, definition, notification)
            if ticket_id is None:
                message = 'Failed to reissue (create another new)_redmine_ticket.'
                current_app.logger.info('[reissue_notification] %s ' % message)
                return result
            exception_message = 'Reissued redmine ticket (id:%d) but failed to update_alert_alarm_escalation; ' % ticket_id
        else:
            exception_message = 'Reissued notification but failed to update_alert_alarm_escalation; '
        escalated = True
        ts_escalated = dt.datetime.strftime(dt.datetime.now(), "%Y-%m-%dT%H:%M:%S")
        try:
            SystemEvent.update_alert_alarm_escalation(id=alert.id, ticket_id=ticket_id,
                                                  escalated=escalated, ts_escalated=ts_escalated)
        except Exception as err:
            message = exception_message + str(err.message)
            current_app.logger.info('[reissue_notification] %s ' % message)
            return result
        result = ticket_id
    except Exception as err:
        current_app.logger.info('[reissue_notification] %s ' % err.message)
    finally:
        return result
def reissue_notification ( alert , definition , notification ) : result = None try : ticket_id = 0 if notification . use_redmine : ticket_id = reissue_notification_redmine ( alert , definition , notification ) if ticket_id is None : message = 'Failed to reissue (create another new)_redmine_ticket.' current_app . logger . info ( '[reissue_notification] %s ' % message ) return result exception_message = 'Reissued redmine ticket (id:%d) but failed to update_alert_alarm_escalation; ' % ticket_id else : exception_message = 'Reissued notification but failed to update_alert_alarm_escalation; ' escalated = True ts_escalated = dt . datetime . strftime ( dt . datetime . now ( ) , "%Y-%m-%dT%H:%M:%S" ) try : SystemEvent . update_alert_alarm_escalation ( id = alert . id , ticket_id = ticket_id , escalated = escalated , ts_escalated = ts_escalated ) except Exception as err : message = exception_message + str ( err . message ) current_app . logger . info ( '[reissue_notification] %s ' % message ) return result result = ticket_id except Exception as err : current_app . logger . info ( '[reissue_notification] %s ' % err . message ) finally : return result
Create another (re-issue notification) as a part of esclation process (for alerts only)
Create another ( re - issue notification ) as a part of esclation process ( for alerts only )
""" Create another (re-issue notification) as a part of esclation process (for alerts only)
    """ # If red mine enabled: # Prepare base exception message for update when using redmine for notification # Prepare base exception message for update when NOT using redmine for notification # update escalate fields
alert
definition
notification