Issue
env.JOB_NAME Is the pipeline name suffixed with the branch name.
So env.JOB_NAME will be <jenkins_pipeline_name>_<my_branch>
How can I just get the pipeline name and store it in a var in the environment{} block at the top of my jenkinsfile to use through the file?
I don't want to resort to scripted pipeline just the declarative.
Solution
@red888 pointed out the following answer that worked like magic for me. I am pointing it out in an actual answer because I almost missed it:
env.JOB_BASE_NAME
Credit to @red888 in the comment above. Send upvotes his/her way.
Answered By - Jeff Diederiks
Answer Checked By - Robin (JavaFixing Admin)