It always overwrites instead of adding - what has to be changed, so it does not. I tried several ways...
Hi @M0214104
Replace the smartvalue in your screenshot with {{issue.fixVersions}}
Additionally refer to 'To edit the field without overwriting its original content:' section of https://support.atlassian.com/automation/kb/how-to-update-a-select-field-multiple-from-the-content-of-other-fields/
Hi @M0214104
For a question like this, context is important for the community to help. Please post the following:
Until we see those...
The Fix Versions field has a list of values in the smart value {{issue.fixVersions}}
Thus you may need to use advanced edit with JSON to add the values from that list:
And, you do not describe what is in your version names. For example, if there are spaces those will not work with labels. They need to be replaced, such as with underscores.
Putting that all together, you could use this dynamic JSON expression to add the labels:
{
"update": {
"labels": [
{{#issue.fixVersions}}
{
"add": {{name.replace(" ", "_").asJsonString}}
}{{^last}}, {{/}}
{{/}}
]
}
}
Please adjust this based on the actual content of your version names.
Kind regards,
Bill
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy and @Fazila Ashraf
We're on Data Center.
Our Release Versions contain an underscore, e.g. PI_25Q4W
I have changed the smartvalue as the additional information, as given above.
Image of the complete automation:
Issue before Automation:
Audit log says it is successful - which it is, it has set the label. BUT it also did overwrite!!!
Issue after Automation:
Why does it do this? It's so not logical, in a bulk change it is possible to add and still have the labels from earlier on.
Thanks so much for your help :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When using the Edit Issue action, a field may be selected from the dropdown list or updated using JSON with "additional fields"...but not both in the same action.
And...I note you changed the dynamic JSON to use both single and double-quotation marks. That will not work, and it is why I used the asJsonString function:
{{name.replace(" ", "_").asJsonString}}
If you are certain your version names will never contain spaces, you may simplify what I suggested earlier to remove that logic:
{
"update": {
"labels": [
{{#issue.fixVersions}}
{
"add": "{{name}}"
} {{^last}}, {{/}}
{{/}}
]
}
}
AND, I fixed a typo from my earlier post as it was missing the pound sign # in the iterator. Please add that to your expression.
Please deselect the field from the dropdown list, update the expression, and re-test. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
You did magic!!!!! It worked - thank you so much :-D
I was not aware that you cannot have both, the "add" and the "additional" one at the same time.
Thank you also for your simplified code - yay! My users will be so happy!
Kind regards
Kathrin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn it is working! Please consider marking this question as "answered" to help others with a similar need find solutions faster. 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.