I am trying to create an automation rule where each time an issue is moved to a new sprint, a new label is added with the name of that sprint.
More specifically, if the issue was added to a sprint that is already in progress, it should receive that label. I'm receiving the following error with the below rule. Can anyone help?
That error tells you Labels cannot contain spaces, which is correct.
Without seeing the details of your edit, I am guessing that you are trying to add to Labels with {{issue.sprint}} or {{issue.sprint.name}}
The sprint field is a list, and when you use it that way it is split into individual values delimited by commas and spaces. So you could remove the delimiters or substitute other values.
However I wonder: do you only want to add one Label for the current open sprint? In that case you may use this expression to process the sprint list with conditional filtering to just get the active sprint's name for the label:
{{#issue.sprint}}{{#if(equals(state, "active"))}}{{name}}{{/}}{{/}}
Kind regards,
Bill
Thanks for the reply @Bill Sheboy . I was using {{sprint.name}}.
But yes, I only want to add the current open sprint to the list of labels. Where would I put the below expression?
{{#issue.sprint}}{{#if(equals(state, "active"))}}{{name}}{{/}}{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The answer depends on whether or not you expect your sprint names will contain spaces:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am glad to learn that worked! Please consider marking this question as answered to help others in the future searching for similar use cases. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.