I am trying to make a rule where when an issue is assigned to a specific set of users, the component field is updated to include a specific component, let's call it "kitttens". I got this automation working, however, it's replacing the values in the component field with "kittens". I want it to say "kittens" and "puppies".
Well this is embarrassing, I solved my own problem =)
In case anyone else needs it, the answer in the automation is edit issue-> components-> "kittens" and "copy from issue"
Glad you found it! Sorry we couldn't get to you before then. ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How do you enter a component in addition to Copy Components from Current Issue? My UI only allows me to select Copy Components from Current Issue and I can't enter anything else.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am also looking for the answer to this. I want to add to existing values in the Components field. Right now my options are only Set or Copy. I would love the options to be the same as it is with Labels where you can specify Set, Add/Remove, or Copy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Chad Vernon and @Karen Corbeill
It appears you want to add additional components, rather than replace or copy them.
To do that, you would use the advanced edit with JSON options. Unfortunately I do not believe you can add just one component value with JSON, like with Labels. Instead you must capture all the existing ones first, add the additional one, and then set them all at once.
Here is a rule which can do that for Jira Cloud. The same can be done with Server/Data Center versions by eliminating the created variables and doing this in one step.
{
"fields": {
"components" : [ {{varNewComponents}} ]
}
}
How this works...
Please try that and let the community know if you need further help with this.
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.
This looks great! I'll have to give it a try. Thank you so much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How do you deal with the case where varCurrentComponents is empty so the resulting json in the last action is invalid?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Chad Vernon
You can use the conditional handling to test for the empty value, and only include/use the JSON when needed. This could also be done with a rule condition.
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.
I ended up using:
{"name": "New Component To Add"} {{#if(not(varCurrentComponents.isEmpty))}}, {{/}} {{varCurrentComponents}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had the same problem: "copy from issue" wasn't available.
Luckly the Jira knowledge base helped out: https://confluence.atlassian.com/automationkb/how-to-add-components-to-issues-with-automation-rules-in-jira-1021222395.html
append one component
{
"update": {
"components": [{
"add": {"name": "Name of the Component"}
}]
}
}
append multiple components
{
"update": {
"components": [{
"add": {"name": "Name of the Component"}
},
{
"add": {"name": "Name of another Component and so on"}
}]
}
}
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.