How can I add members into cards by rules?
Asked by The Admin:

Hi,

I would like to add members to a newly created card, but I haven't find nor figured out a sufficient solution...

Process by rules:

+ when all checklist are completed

- find card in list on board

- copy it to another list

- rename it

- add members

I am using custom fields and in certain cases I use it also to add members. However, I am not able to figure out a sequence of rules that would enable me to change the custom field from the trigger card that would either work or wouldn't end up in a loop.

Also, command "add member @{triggercardmemberusernames} to the card" doesn't seem to work even though the member is on both boards, and I would very much expect the command "{cardmemberusernames}" to be applicable to the the newly created card and not to the trigger card. Anyway, I tried it and in both cases the error in the command says "I couldn't find that member in this board."

Do you know any way to add members by rules from card in one board to another card in another board with different names?

Thank you.

*** ** * ** ***

Edit 2022-05-17: The sample command is as follows:

when a card is added to list "List1", find a card titled "Card_Template" in list "Templates" on board "Board3", copy the card without comments to the top of list "List2" on board "Board3", rename the card to "Card template {triggercardname} ({triggercardlabelnames})", set the card's description to "{triggercarddescription}", find a card titled "{triggercardname}" in list "List1" on board "Board1", link the cards together, find a card titled "{triggercardname}" on board "Board2", link the cards together, find a card titled "{triggercardname}" in list "List1" on board "Board1", for each card linked in the attachments, set custom field "Field1" to "{{%Field1}}", and set custom field "Field2" to "{{%Field2}}"


Answers:
author: Hannah Humbert - Simpla Workflows
body: [@The Admin](/t5/user/viewprofilepage/user-id/4916729)  

Welcome to the community :)
> I am using custom fields and in certain cases I use it also to add members. However, I am not able to figure out a sequence of rules that would enable me to change the custom field from the trigger card that would either work or wouldn't end up in a loop.

<br />

Are you able to clarify what part of the command incorporates custom fields? Is the idea to update a custom field in the trigger card and have that new value copy to the "action" or newly created card?  

> Also, command "add member @{triggercardmemberusernames} to the card" doesn't seem to work even though the member is on both boards, and I would very much expect the command "{cardmemberusernames}" to be applicable to the the newly created card and not to the trigger card. Anyway, I tried it and in both cases the error in the command says "I couldn't find that member in this board."

<br />

Am I right in assuming you're trying to copy the members from the trigger card to the newly created card? If so, it's not possible to use the trigger pre-fix with member variables:  

![variable prefix.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/197007iA26394945E0858CA/image-dimensions/489x306?v=v2 "variable prefix.PNG")  

<br />

comments: author: The Admin
body: Thank you for the welcome and for your reply :)

> Are you able to clarify what part of the command incorporates custom fields? Is the idea to update a custom field in the trigger card and have that new value copy to the "action" or newly created card?

The command is as follows:

<br />

when a card is added to list "List1", find a card titled "Card_Template" in list "Templates" on board "Board3", copy the card without comments to the top of list "List2" on board "Board3", rename the card to "Card template {triggercardname} ({triggercardlabelnames})", set the card's description to "{triggercarddescription}", find a card titled "{triggercardname}" in list "List1" on board "Board1", link the cards together, find a card titled "{triggercardname}" on board "Board2", link the cards together, find a card titled "{triggercardname}" in list "List1" on board "Board1", for each card linked in the attachments, set custom field "Field1" to "{{%Field1}}", and set custom field "Field2" to "{{%Field2}}"

so the main idea is to have the single source of truth over several boards from which if the field is updated the new value is distributed. Also it is this one card on "List1" which is supposed to be accessed when a new card is copied from template and from which the values are taken.

> Am I right in assuming you're trying to copy the members from the trigger card to the newly created card? If so, it's not possible to use the trigger pre-fix with member variables:

Thank you for clarification. I haven't realized that the trigger prefix is not supposed to work...


author: Theodoro Reato
body: Hi there,

Hum, I tried to copy a card and add a member to the card, and I was able to do it with the Members's tab, as you can see on the image below.

Looks like you are adding the wrong parameter to add the member, as you can find on this [article](https://help.trello.com/article/1160-custom-field-variables#custom-field-variables) it should be @{{%triggercardmemberusernames}} (if triggercardmemberusernames is the name of your custom field). Can you test it?

![Screen Shot 2022-05-10 at 3.04.20 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/196711i6EFBC5ADC8D42D1B/image-size/large?v=v2&px=999 "Screen Shot 2022-05-10 at 3.04.20 PM.png")

comments: author: The Admin
body: Thank you for reply.

I have tried both {{%FieldName}} and {customfieldvalue} without much effect, however, the issue most probably is within the whole structure of the rule (below and I probably should have sent it right away...).

I am aware of the structure {{%FieldName}} and I use it at several places when I want to exchange the values from one field to another, such as calculations of increments and differences between previous and current value. However, another level of the issue is that I use abbreviations of names for the field values and based on that the user with Trello alias is added. And by rules it could work just as well other way around, even though then the loop probably could not be avoided...

The {triggercardmemberusernames} should have been a value coming from trigger card and utilizing the native cardmemberusernames command.

*** ** * ** ***

when a card is added to list "List1", find a card titled "Card_Template" in list "Templates" on board "Board3", copy the card without comments to the top of list "List2" on board "Board3", rename the card to "Card template {triggercardname} ({triggercardlabelnames})", set the card's description to "{triggercarddescription}", find a card titled "{triggercardname}" in list "List1" on board "Board1", link the cards together, find a card titled "{triggercardname}" on board "Board2", link the cards together, find a card titled "{triggercardname}" in list "List1" on board "Board1", for each card linked in the attachments, set custom field "Field1" to "{{%Field1}}", and set custom field "Field2" to "{{%Field2}}"

Can you find the reason why the rule doesn't forward the Field1 and Field2 to the new card?


Tags: butler

custom-field