assignExtraMetrics(ctx, name, payload) {
		let def = ctx.action.metrics[name];
		// if metrics definitions is boolean do default, metrics=true
		if (def === true) {
			payload[name] = ctx[name];
		} else if (Array.isArray(def)) {
			payload[name] = _.pick(ctx[name], def);
		} else if (isFunction(def)) {
			payload[name] = def(ctx[name]);
		}
	}
Assign extra metrics taking into account action definitions

@param {Context} ctx
@param {string} name Field of the context to be assigned.
@param {any} payload Object for assignment.

@private