ooiservices/app/main/notifications_redmine.py
def create_redmine_notification(alert_alarm, alert_alarm_definition, user_event_notification):
    """ Create redmine notification (ticket) to begin notification process using redmine. Returns ticket_id or None.
    """
    result = None
    try:
        # Populate required fields to create a redmine ticket
        project = current_app.config['REDMINE_PROJECT_ID']

        # Use user_event_notification for determining assigned user's redmine id
        redmine_id = 1  # this assumes Redmine Admin is assigned to redmine user id 1
        assigned_user = User.query.get(user_event_notification.user_id)
        if assigned_user is not None:
            name = assigned_user.first_name + ' ' + assigned_user.last_name
            tmp_id = get_user_redmine_id(project, name)
            if tmp_id is not None:
                redmine_id = tmp_id

        # Create redmine ticket
        prefix = (alert_alarm.event_type).upper() + ': '
        subject = prefix + alert_alarm.event_response
        description = alert_alarm.event_response
        priority = alert_alarm_definition.severity
        result = create_redmine_ticket_for_notification(project, subject, description, priority, redmine_id)
        return result

    except Exception as err:
        message = '[create_redmine_notification] %s ' % err.message
        current_app.logger.info(message)
        return result
 Create redmine notification (ticket) to begin notification process using redmine. Returns ticket_id or None.
    
Create redmine notification (ticket) to begin notification process using redmine. Returns ticket_id or None.
Create redmine notification ( ticket ) to begin notification process using redmine . Returns ticket_id or None .
def create_redmine_notification(alert_alarm, alert_alarm_definition, user_event_notification):
    result = None
    try:
        project = current_app.config['REDMINE_PROJECT_ID']
        redmine_id = 1  
        assigned_user = User.query.get(user_event_notification.user_id)
        if assigned_user is not None:
            name = assigned_user.first_name + ' ' + assigned_user.last_name
            tmp_id = get_user_redmine_id(project, name)
            if tmp_id is not None:
                redmine_id = tmp_id
        prefix = (alert_alarm.event_type).upper() + ': '
        subject = prefix + alert_alarm.event_response
        description = alert_alarm.event_response
        priority = alert_alarm_definition.severity
        result = create_redmine_ticket_for_notification(project, subject, description, priority, redmine_id)
        return result
    except Exception as err:
        message = '[create_redmine_notification] %s ' % err.message
        current_app.logger.info(message)
        return result
def create_redmine_notification ( alert_alarm , alert_alarm_definition , user_event_notification ) : result = None try : project = current_app . config [ 'REDMINE_PROJECT_ID' ] redmine_id = 1 assigned_user = User . query . get ( user_event_notification . user_id ) if assigned_user is not None : name = assigned_user . first_name + ' ' + assigned_user . last_name tmp_id = get_user_redmine_id ( project , name ) if tmp_id is not None : redmine_id = tmp_id prefix = ( alert_alarm . event_type ) . upper ( ) + ': ' subject = prefix + alert_alarm . event_response description = alert_alarm . event_response priority = alert_alarm_definition . severity result = create_redmine_ticket_for_notification ( project , subject , description , priority , redmine_id ) return result except Exception as err : message = '[create_redmine_notification] %s ' % err . message current_app . logger . info ( message ) return result
Create redmine notification (ticket) to begin notification process using redmine.
Create redmine notification ( ticket ) to begin notification process using redmine .
""" Create redmine notification (ticket) to begin notification process using redmine. Returns ticket_id or None.
    """ # Populate required fields to create a redmine ticket # Use user_event_notification for determining assigned user's redmine id # this assumes Redmine Admin is assigned to redmine user id 1 # Create redmine ticket
alert_alarm
alert_alarm_definition
user_event_notification