Assign sprint label based on pipeline?

Hi

We have (what I guess is) a pretty standard setup of pipelines: product backlog, sprint backlog, in progress, in review, closed. The problem we have though is that the sprint labels are completely unaware of this structure - as issues move in and out of these pipelines, the sprint labels are unaffected. We end up fighting a rearguard action where someone (me!) has to go through the board every sprint (weekly) and fix up all the sprint labels. This feels like a bit of a waste of time!

It would be great if this flow could be automated somehow - maybe allowing pipelines to have one of three options assigned: issues in this pipeline are automatically assigned to the current sprint; issues in this pipeline are removed from the current sprint; issues in this pipeline do not have sprints reassigned automatically".

On a related note - sometimes we don’t finish an issue in a sprint, and at planning at the start of the week it gets booted back into the backlog because something more urgent has come up. Here, automatic sprints work against us - issues keep rolling through the sprint because someone forgot to remove the original sprint label. I think an automation like the above would probably address this too.

Thanks
Dan