Hi Jonny,
For task jobs submitted to Slurm, Cylc automatically sets the job name to <suite-name>.<task-name>.<cycle-point>. E.g. for the "20181011T00Z" instance of task "model" in suite "nwp", you would see this in the generated task job script:
...
# DIRECTIVES:
#SBATCH --job-name=nwp.model.20181011T00Z
...
If you change this to just the suite name, you won't be able to distinguish different jobs within the same suite (by interrogating slurm).
So it seems to me you just need `squeue` to print the full Job ID instead of a truncated version of it. You can do presumably do that with the squeue formatting option in David's first reply. The way I do it is by setting $SQUEUE_FORMAT in my environment, e.g.:
export SQUEUE_FORMAT="%.10i %.20P %.30j %.8u %.2t %.10M %.6D %.20R %q"
("%.30j" means print job names up to 30 characters long).
Hilary
p.s. The reason your attempted use of "$(basename "$PWD")" failed is that slurm directives are embedded in bash comments (#SBATCH --job-name=...), so bash does not evaluate them when the job runs. But even if bash did evaluate them as shell expressions, you would not get the result you want because Cylc executes jobs in a task-specific "work directory", not in the top level suite run directory!