In order to track issues added to the sprint after sprint start, I am trying to set up an automation as follows:
{
"update": {
"labels": [{
"add": {{issue.sprint.last.name.asJsonStringArray.replace(" ","-")}}
}]
}
}
When the sprint is started, issues in that sprint are edited: they receive a label that is copied from the name of the current sprint.
Jira throws an error about the JSON. I have to use this because the 'Choose fields to set' does not allow me to add a new label on top of the existing ones.
On the screenshot above, it says 'The JSON is valid' but the audit log says 'Error while parsing additional fields. Not valid JSON.'
When I type:
{
"update": {
"labels": [{
"add": {{issue.sprint.last.name.asJsonStringArray.replace(" ","-")}}
}]
}
}
it throws the error "The label 'TEST Sprint 10' can't contain spaces. (labels))" so I suspect it's the attempt to remove spaces that doesn't work.
Any help to make this work would be greatly appreciated.
Rather than using the JSON to repeatedly extract the value, I recommend using a variable to capture it one time (from the trigger value) and then using the Edit Issue and Labels field ... ADDREMOVE option to make the update.
For example:
Kind regards,
Bill
Hi @Bill Sheboy , thank you that worked perfectly. I wasn't sure how variables worked but that solved the issue.
For anyone else reading, it did not remove prior labels and it only added the current sprint as label, even if the issue had been in several sprints before.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
This is exactly what I need to do but I am not sure if I am doing it on the right way since it is not working to me.
Can someone check what am I doing wrong?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
This is exactly what I need to do but I am not sure if I am doing it on the right way since it is not working to me.
Can someone check what am I doing wrong?
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can add additional labels by using the smart value {{issue.labels}} and the label that you want to add. See the following. This works in my testing.
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.