def getMultiMessageAttributeIndex(multiMessageAttr, incomingAttr):
    """Returns the index of the incoming attribute connection to the given multi attribute."""
    connectionList = multiMessageAttr.listConnections(plugs=True)
    for connection in connectionList:
        if connection == incomingAttr:
            return connectionList.index(connection)