CreateAssetMenu() not working?

I am using unity version: 2021.3.12f1

using UnityEngine;

[CreateAssetMenu(fileName = "New Item",menuName = "Item")]
public class Item : ScriptableObject
    public int id;
    public string itemName;
    public int value;
    public Sprite icon;

Please provide the order as well… So your createAssetMenu header would look like
[CreateAssetMenu(fileName = “New Item”,menuName = “Item”, order = 2)]

So that you can find the New Item in the Assets → Create → Item

If you don’t need it under the Assets menu and you want in a separate menu Item, you can use
[MenuItem(“Item/New Item”)].
Note: If you are using this make sure to use using UnityEditor;