CANT_PARSE_COMMAND error when I try to add a new Butler rule
Asked by iliaskzz:

Hi all,

I'm trying to implement a Butler rule where basically the following happens :

- an checklist item is added

- the item is assigned to a member based on whose name is mentionned in the custom field "Project Initiator"

which means that the custom field is variable. Therefore, instead of creating the rule multiple times (when member A is the project initiatior then assign the item to member A) I wanted to use the variables as mentionned in this post (<https://support.atlassian.com/trello/docs/working-with-custom-fields/#custom-field-variables>)

So what I tried to do is create the following Butler rule :

- when item XX is added to checklist YY

- assign the item to member @{{%Project Initiator}}

where the project initiator values in the custom field will be the Trello usernames of the members (as I guess there is no other way Trello can match betwwen a full name and a username)

However, when I try to save the rule I get an error saying "CANT_PARSE_COMMAND"

Have you faced a similar problem ? is there something to change in my approach ?

You can find the screenshots for more detail![Butler rule.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/202388i31F2978CB115AF62/image-size/large?v=v2&px=999 "Butler rule.PNG")![Custom field.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/202389i4125403F635EF1AC/image-size/large?v=v2&px=999 "Custom field.PNG")


Answers:
author: milynnus
body: [@iliaskzz](/t5/user/viewprofilepage/user-id/4591236)

Had observed the same. Currently, I had to use http request to an endpoint to handle this.

comments: author: iliaskzz
body: can you please share an example with me ? Thanks a lot


author: milynnus
body: [@iliaskzz](/t5/user/viewprofilepage/user-id/4591236)

Here's the documentation of my collection.   

<https://github.com/xu2xulim/Superhero>


author: iliaskzz
body: How can I use it to implement the workflow mentionned in my oroginal post ? I have used http requests before on Butler, but not sure how to use your collection for the use case I mentionned

Thanks


author: milynnus
body: [@iliaskzz](/t5/user/viewprofilepage/user-id/4591236)

<https://github.com/xu2xulim/Superhero/blob/master/Superhero%20on%20deta/Micros/Checklist.md>

This is the payload example.

{ "item_name": "An Item on Advanced Checklist", "username": "@any_username", "due": "2022-05-16", "checklist_name": "Advanced Checklist from Zapier", "cardname": "Advanced Checklist from Zapier", "board_id": "5fdd5.........792101e" }

So it depends on your workflow

If your trigger is when you add an item, then the

{ "item_name": "{checklistitemname}", "username": "{{%username}}", "due": "{{%date}}", "checklist_name": "{checklistname}", "cardname": "{cardname}", "board_id": "{boardid}" }

1. Above is done without testing.
2. as I was writing ...wondered to myself why I used cardname and not cardidlong
3. Also note that there is a rent change in Trello for an attribute that might affect this


author: milynnus
body: [@iliaskzz](/t5/user/viewprofilepage/user-id/4591236)

Answering my own question, this was written to create a new card. So it might have to change a bit for your specific use case.


author: milynnus
body: [@iliaskzz](/t5/user/viewprofilepage/user-id/4591236)

Just created this but have not test it since I do not have a standard plan. This should be good for when you add an item to a checklist.

![Screen Shot 2022-06-18 at 7.43.40 AM.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/202457i7A01D3EDA97A9C3F/image-size/large?v=v2&px=999 "Screen Shot 2022-06-18 at 7.43.40 AM.jpg")


author: milynnus
body: [@iliaskzz](/t5/user/viewprofilepage/user-id/4591236)

Tested with this automation. I cannot see the member or due updated because checklist is on free workspace

username format {{%Name}} is @username

Author's note : the link in the sample is provided FYI.
> when an item is added to checklist "{\*}" in a card with custom fields "Name" and "Date (Text)" completed, post to url "[https://hfetwp.deta.dev1/new_item_assign_due?api_key=14a..............21d7\&token=be9f...................b4](https://hfetwp.deta.dev/new_item_assign_due?api_key=14a..............21d7&token=be9f...................b4)" with payload "{ "card_id": "{cardidlong}", "checklist_name": "{checklistname}", "item_name": "{checklistitemname}", "username": "{{%Name}}", "due": "{{%Date (Text)}}"}"


author: iliaskzz
body: I tried it on a paid plan board and it does not seem to work. I get this error in Butler logs

![Butler log.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/202881i865D398836FCB74E/image-size/large?v=v2&px=999 "Butler log.PNG")


author: iliaskzz
body: [@milynnus](/t5/user/viewprofilepage/user-id/3947182) I found out I was not including the due date in the request and it's a required field. I added that to the rule but I still get the same 422 error

(I put a standard date in a string format as I have another use case to assign date, the most important thing for the rule is to assign the item to members based on the value of the custom field "Project Initiator")

![Butler log 2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/202883i4F5602FC257299F6/image-size/large?v=v2&px=999 "Butler log 2.PNG")


author: milynnus
body: [@iliaskzz](/t5/user/viewprofilepage/user-id/4591236)

The due date is just a meaningful date field(text) like 2022-06-22. You should be able to get a string format from your program. If you are using a date cf you should be able do it as well.

Try "due": "{{%Required By}\~YYYY-MM-DD}"


Tags: butler