Hello! I'm trying to create an automation, but I'm failing to do so. Any kind of help is appreciated :
I have a Product field with multiple values:
I also have a Components with the abbreviation of each of those Products (among other values):
What I would like to do is to automatically update the Components field based on what the user selects in the Product field.
So I managed to create an automation which updates the field and everything works. But it always replaced the value instead of "keep the existing ones and add the new one".
I found this page here : https://support.atlassian.com/cloud-automation/docs/edit-issue-fields-with-jira-automation/
As you see from the section Add values to multi-select fields, it should be fairly simple as I can just select 'Copy from Issue' and then also together, add the new value. The screenshot below shows the example for that:
However, my JIRA (cloud version) doesn't have that option to 'Copy from issue'.
Any idea how can I achieve that (or any other ideas on how to do that in an easier way is also appreciated).
Thanks,
Can you share the full details of your Cloud automation?
I did some tests here and I can confirm that Cloud has the "Copy value from issue" option, but I didn't want to give you an answer that might not be so helpful.
If you can share how your automation is formed, maybe I can help you fix it and get the expected result.
Hi @Fernando Eugênio da Silva , thank you for helping out on that issue.
I took a screenshot here of all the steps, here it goes:
As you see, it's a really simple rule.
What happens now is that on the 'Edit Issue' (the 3rd step), when selecting the component, I can only select the existing ones. I don't have an option to 'Copy from issues'.
If I click on the [ ... ] next to the component field, then I have those options, but in none of them I managed to add 'AV'+ 'Copy from Issue', It's either one or another.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also just to add on that issue, there was a previous post and I believe the user had the same issue as me, but as you can see, his screenshots don't load and neither he answered my follow-up on how he solved :
Perhaps the discussion above can bring some light in the solution of this problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The "ADD existing values" feature to components is only available using "Copy from".
The only possible way for you to do this is as follows:
Add a new ACTION of yours where you select the "AV" component
In this new ACTION, select the EDIT issue for the "Component" field and this time make the formula for the "Copy from".
Keep the "ADD existing values" checked and the value will be added normally next to the "AV" component.
This is the logic you should use. First add the choice component, then add a new "copy from" selection component ACTION:
The first ACTION would be from COMPONENT "AV" and the second ACTION would be from Component "Copy from".
They need to be in this order.
I tested it here and it worked perfectly.
Test and let me know if you have any problems.
Regards,
Fernando
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another solution that I ended up developing here very quickly and practically and that certainly works is to use the JSON language to update the Component adding the value you want.
See the payload below:
{
"update": {
"components": [
{
"add": {
"name": "AV"
}
}
]
}
}
For that you don't need to put the Component in the EDIT issue function. Just enter this payload here:
Just select "EDIT ISSUE";
Do not select the "Components" field;
Click on "Additional FIelds" and include this payload.
Jira will only ADD to existing components, the one you are including in the payload :D
Kind Regards,
Fernando
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Fernando, you are a legend!
I tried both ways and it worked.
I ended up going with the json snippet, so I could keep the structure of my automation a bit leaner.
Thanks a lot for your help! That's very appreciated. I'll mark your post as a solution in case other people have the same issue.
Thanks a lot again, I wish you a wonderful day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Fernando Eugênio da Silva I'm still having trouble with this myself when trying to add additional values to a multi-select field using the steps above.
I have two "Edit Issue" components after an IF condition to check if the description contains corresponding keywords.
Then I have subsequent IF conditions that check for other keywords and then two more Edit Issue components after each of those doing the same thing. The first step on each one seems to be adding the new value but then it's overwritten immediately by the next Edit Issue component...
What am I doing wrong here and why is this so diffffffficult?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've also tried the alternate suggestion using the following:
{
"update": {
"Download Options": [
{
"add": {
"name": "ABC"
}
}
]
}
}
This does add the value to that field but then subsequent "Edit Issue" components don't add their values too.
For example if the one above is first in line, the "ABC" option is selected. But if I have a second "Edit Issue" component after that with the following:
{
"update": {
"Download Options": [
{
"add": {
"name": "DEF"
}
}
]
}
}
This should add "DEF" as an option in addition to "ABC" but I end up with just "ABC".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah ha! I found something that worked,
I needed to use "value" rather than "name" when referencing my field
{
"update": {
"customfield_10116": [
{
"add": {
"value": "ABC"
}
}
]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great!! I would say to you change "name" to "value", it's because custom field select list (multiple choices) are different than "Components" field in jira.
Glad to hear you made it lol
Any questions, let us know
best
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.