Jetbrains Datagrip icon cannot lock to the launcher

Use the command described by @JonasCz. "Tools" > "Create desktop entry / launcher"

Then go to unity, search for DataGrip and drag it to the bar.

I don't know why pinning it doesn't work but the above worked for me. I imagine it has to do with pining the shortcut vs the running java app. The shortcut is probably a wrapper to start the main app.