def _getChainKey(arguments, keyName):
    """
    Given a request arguments dictionary and a key name, properly returns its
    value regardless of the request type.
    """
    if 'TaskChain' in arguments:
        value = arguments['Task1'].get(keyName)
    elif 'StepChain' in arguments:
        value = arguments['Step1'].get(keyName)
    else:
        value = arguments.get(keyName)
    return value
