It isn't a good practice to upload an artifact if your build fail. I recomend you to create a new pipeline or to edit your actual pipeline.
If your artifact is building sucessfully but your pipeline if failing you can upload it using Jfrog Cli with this command in your pipeline code:
For packed (jar, zip...) artifact:
jfrog rt upload "JENKINS_PATH_TO_YOUR_ARTIFACT/*" YOUR_ARTIFACTORY_REPO/
For unzip or unpacked artifact:
jfrog rt upload --flat=false "JENKINS_PATH_TO_YOUR_ARTIFACT/*" YOUR_ARTIFACTORY_REPO/
Check Jfrog Cli manual:
Jfrog Cli
Check my post with similar task using Bamboo: Upload artifact to Jfrog Artifactory using Jfrog CLI