def hipchat(registry, xml_parent, data):
 hipchat = XML.SubElement(xml_parent, 'jenkins.plugins.hipchat.HipChatNotifier')
 XML.SubElement(hipchat, 'token').text = str(data.get('token', ''))
 if ('rooms' in data):
  XML.SubElement(hipchat, 'room').text = str(','.join(data['rooms']))
 mapping = [('notify-start', 'startNotification', False), ('notify-success', 'notifySuccess', False), ('notify-aborted', 'notifyAborted', False), ('notify-not-built', 'notifyNotBuilt', False), ('notify-unstable', 'notifyUnstable', False), ('notify-failure', 'notifyFailure', False), ('notify-back-to-normal', 'notifyBackToNormal', False)]
 helpers.convert_mapping_to_xml(hipchat, data, mapping, fail_required=True)
 if ('start-message' in data):
  XML.SubElement(hipchat, 'startJobMessage').text = str(data['start-message'])
 if ('complete-message' in data):
  XML.SubElement(hipchat, 'completeJobMessage').text = str(data['complete-message'])

def hipchat ( registry , xml_parent , data ) : hipchat = XML . SubElement ( xml_parent , 'jenkins.plugins.hipchat.HipChatNotifier' ) XML . SubElement ( hipchat , 'token' ) . text = str ( data . get ( 'token' , '' ) ) if ( 'rooms' in data ) : XML . SubElement ( hipchat , 'room' ) . text = str ( ',' . join ( data [ 'rooms' ] ) ) mapping = [ ( 'notify-start' , 'startNotification' , False ) , ( 'notify-success' , 'notifySuccess' , False ) , ( 'notify-aborted' , 'notifyAborted' , False ) , ( 'notify-not-built' , 'notifyNotBuilt' , False ) , ( 'notify-unstable' , 'notifyUnstable' , False ) , ( 'notify-failure' , 'notifyFailure' , False ) , ( 'notify-back-to-normal' , 'notifyBackToNormal' , False ) ] helpers . convert_mapping_to_xml ( hipchat , data , mapping , fail_required = True ) if ( 'start-message' in data ) : XML . SubElement ( hipchat , 'startJobMessage' ) . text = str ( data [ 'start-message' ] ) if ( 'complete-message' in data ) : XML . SubElement ( hipchat , 'completeJobMessage' ) . text = str ( data [ 'complete-message' ] )
yaml: hipchat publisher that sends hipchat notifications on job events requires the jenkins :jenkins-wiki:hipchat plugin <hipchat+plugin> version >=1 .