Approriately change if needed for master and staging.
git log origin/staging..origin/dev --oneline --no-mergesPress enter and grab all the result in clipboard
Store the result in a variable like this. Make sure there are no tilds in the result.
const commits = `CPT-1233: I did something
CPT-4312: You did something`Modify CPT or DGN according to your jira prefix
const regex = /[CPT,DGN,AP,MBC,DVOP]{2,}-\d{2,}/g
const branches = commits.match(regex)
const set = new Set(branches)
Array.from(set).join(', ')You get the unique branches that are going to staging