async function newIncident(user, payload, userList) {
  const { me } = user
  const opUserEmail = me.email
  const from = await matchUser(opUserEmail, userList)
  try {
    const {
      body: { incident },
    } = await pd.incidents.createIncident(from[0].email, payload)
    return incident
  } catch (err) {
    await handleError(err, 'Failed to create the incident')
  }
}
/**
 * newIncident adds a new PagerDuty incident to the linked account
 *
 * @param {object} user     The current SDK user
 * @param {object} payload The data to create the incident with
 * @param {array} userList Optional. A list of users to match on
 *
 * @return {object} The created incident
 */
newIncident adds a new PagerDuty incident to the linked account
@param {object} user     The current SDK user
@param {object} payload The data to create the incident with
@param {array} userList Optional. A list of users to match on

@return {object} The created incident
newIncident adds a new PagerDuty incident to the linked account @param { object } user The current SDK user @param { object } payload The data to create the incident with @param { array } userList Optional . A list of users to match on @return { object } The created incident
async function newIncident(user, payload, userList) {
  const { me } = user
  const opUserEmail = me.email
  const from = await matchUser(opUserEmail, userList)
  try {
    const {
      body: { incident },
    } = await pd.incidents.createIncident(from[0].email, payload)
    return incident
  } catch (err) {
    await handleError(err, 'Failed to create the incident')
  }
}
async function newIncident ( user , payload , userList ) { const { me } = user const opUserEmail = me . email const from = await matchUser ( opUserEmail , userList ) try { const { body : { incident } , } = await pd . incidents . createIncident ( from [ 0 ] . email , payload ) return incident } catch ( err ) { await handleError ( err , 'Failed to create the incident' ) } }
newIncident adds a new PagerDuty incident to the linked account
 @param {object} user     The current SDK user
 @param {object} payload The data to create the incident with
 @param {array} userList Optional.
newIncident adds a new PagerDuty incident to the linked account @param { object } user The current SDK user @param { object } payload The data to create the incident with @param { array } userList Optional .