For this feature to work, Jenkins build config must use Archive the Artifacts publisher. It will use Archive the Artifacts include and exclude fields if a file will be attached. If Archive the Artifacts is not set, the feature will do nothing.