Miko Posted March 18, 2013 Share Posted March 18, 2013 (edited) Trello Workflow for Alfred App v.1.6.1 Create cards in Trello using Alfred App https://www.alfredapp.com/ Download Trello WorkFlow 1.6.1 Install Double click on the "Trello Workflow for Alfred v.1.6.1" workflow that you have just downloaded. More info: https://www.alfredapp.com/help/workflows/ Note: if you have version 1.5 installed, remove it before installing the new version. Setup Generate your Trello Developer API Key Use the keyword "get trello key" to generate your Trello Developer API Key. More information: https://developers.trello.com/docs/api-introduction. Note: Make sure to be logged in Trello in your default browser before generating your API Key. Copy your API Key Authorize Trello Workflow Use the keyword "get trello token" plus your "API Key" to authorize the Trello Workflow to use your Trello account Example: get trello token 00000000000000000000 More information: https://developers.trello.com/docs/api-introduction Allow Trello Workflow to use your account Copy your Token Your Trello board id Choose the Trello board that you wish to use with Trello Workflow and copy the board id You can get the board id by simply going to your board and add .json at the end of the URL. Example: Go to the Trello developmemt Roadmap Board https://trello.com/b/nC8QJJoZ/trello-development-roadmap. To view the board id add .json at the end of the URL https://trello.com/b/nC8QJJoZ/trello-development-roadmap.json. You should now see the full JSON {"id":"4d5ea62fd76aa1136000000c","name":"Trello Development Roadmap","desc":"","descData" The board id in the example is: 4d5ea62fd76aa1136000000c Open the Trello Workflow for Alfred in Alfred app. Use the Keyword Alfred to Show Alfred Preferences. Navigate to Workflows and select Trello Workflow for Alfred v1.6 from the side column. Double click on the /bin/bash script and enter your API Key, Your Token and your board id here: key='{YourAPIKey}' token='{YourPersonalToken}' boardid='{YourBoardId}' Make sure that each preference in the bash file is within single quotes: key='00000000000' token='0000000000000000000000000000000' boardid='0000000' Click Save Usage General usage trello {field} separate fields using ; You can choose to have spaces or not between fields. For example {field1}; {field2} and {field1};{field2} will work. Available fields: {Card Title}; {Card Description}; {Labels}; {Due Date}; {List Name}; {Card Position} Basic Usage Card Title trello make dinner reservation will create a card on your board on the first list with the title "make dinner reservation" Card Description trello make dinner reservation; table for 10 people at around 7:30pm will create a card on your board on the first list with the title "make dinner reservation" and description "table for 10 people at around 7:30pm" Labels trello make dinner reservation; table for 10 people at around 7:30pm; blue will create a card on your board on the first list with the title "make dinner reservation" and description "table for 10 people at around 7:30pm" with a "blue" label Available Labels all (will add green, yellow, orange, red, purple and blue) green yellow orange red purple blue You can add more than one label by comma separating them. trello make dinner reservation; table for 10 people at around 7:30pm; blue,red,yellow Please note: Make sure not to have spaces between comma separated labels. Custom labels are not supported. If you find a way let me know Due Date trello make dinner reservation; table for 10 people at around 7:30pm; blue; 04/26/2018 will create a card on your board on the first list with the title "make dinner reservation" and description "table for 10 people at around 7:30pm" with a "blue" label. The due date will be set as 04/26/2018 List Name trello make dinner reservation; table for 10 people at around 7:30pm; blue; 04/26/2018; Today will create a card on your board on the list Today with the title "make dinner reservation" and description "table for 10 people at around 7:30pm" with a "blue" label. The due date will be set as 04/26/2018. Please note: List name are case sensitive today will not work if your list is named Today. The example will only work if you have a list named Today, otherwise the card will be created on your first list. Card Position trello make dinner reservation; table for 10 people at around 7:30pm; blue; 04/26/2018; Today; top will create a card on your board on the list Today with the title "make dinner reservation" and description "table for 10 people at around 7:30pm" with a "blue" label. The due date will be set as 04/26/2018. Note: If you don't specify a card position, your new card will automatically be placed at the end of the list. Available options (case sensitive) top bottom bottom top Advanced Usage You can skip any of the available fields by simply adding ; {Card Title}; {Card Description}; {Labels}; {Due Date}; {List Name}; {Card Position} For example if I wanted to post a card with Title, Label and a Due date i would use this syntax {Card Title}; ; {Labels}; {Due Date} trello Clean my car; ; red; 04/29/2018 Or a card with title only but on a different list {Card Title}; ; ; ; {List Name} trello Clean my car; ; ; ; Upcoming Environment Variables by @gamell Given that some might want always to create the cards on the same list, or with the same label, or same due date, or same position by default, I added the ability to set those defaults via the environment variables trello.list_name, trello.label, trello.due and trello.position. One can conveniently add or edit those environment variables without programming knowledge through the Alfred Workflow editor, clicking on the [x] button on the top right (see screenshot below). Note: If you don't set the variable, the workflow will behave as it did before. FAQ Coming soon License MIT © Miko Magni Edited August 16, 2018 by Miko New Version 1.6.1 Leech and Cedric 2 Link to comment
Leech Posted March 18, 2013 Share Posted March 18, 2013 Awesome! Is there a way to choose to which Board the card is created to? Link to comment
sjugge Posted March 18, 2013 Share Posted March 18, 2013 Stopped by to say thanks, works great and how awesome the documentation is Awesome! Is there a way to choose to which Board the card is created to? Yes, check the documentation (pdf in download) for installation and config details. Leech and Miko 2 Link to comment
Leech Posted March 18, 2013 Share Posted March 18, 2013 Stopped by to say thanks, works great and how awesome the documentation is Yes, check the documentation (pdf in download) for installation and config details. Excellent, thanks! Link to comment
stig77 Posted March 25, 2013 Share Posted March 25, 2013 I really like this, but have a question about the board to which it posts. I have many different boards for different projects. Is it possible to link my overall Trello account and post to a particular board in that account? As of now I can only see how to post to a single board of many, although I do see how to send to a particular list in that board. Like it a lot, but it would be even more useful to select a board and a list name. (Of course, that may be impossible based on Trello's settings!) Thanks. Link to comment
Colorful Tones Posted March 29, 2013 Share Posted March 29, 2013 This is super helpful, and appreciate the time and energy! If you're taking feature requests...it would be awesome to be able to add to a ToDo list, on a card, on a board. Not sure if Trello's API allows for that much? Taking it even further...I have a board I use as a template, and it would be awesome to be able to create a new board from 'Copy Board' in Trello, and start adding to the To Do list I have associated with the template's first card. I know I'm asking a lot for nothing Thanks again for useful workflow! Link to comment
Stef Posted August 29, 2013 Share Posted August 29, 2013 Hello, I can't make it work. When I create a new card, I have the notification error "Warning : Invalid argument supplied for foreach(in) in Users/[myname]/Library/Appli..." Is it due to the fact that my board is is not a number but a name? Please help Stephane Alfred for Trello (v1.0) - Download here (Github) Use keyword "trello" to create a card in Trello. Require a free account with Trello.com <-- Recommend link or go to Trello.com Usage trello card name; description Example: trello Do work!; seriously, do work Do work! Will be the Card titleseriously, do work Will be the Card description Alternatively you can select any text and press "Option + Command + t" (or your custom hotkey) to create a card in Trello with the selected text. Setup Please refer to the included step by step instructions. Credits Tom LongoMiko Magni Screenshots Selected text to Trello card Link to comment
Miko Posted September 3, 2013 Author Share Posted September 3, 2013 (edited) Updated setup instructions to reflect the new permalink structure in Trello. https://github.com/MikoMagni/Alfred-for-Trello/blob/master/README.md#setup Thanks Stephane for letting me know about the issue Edited September 3, 2013 by Miko Link to comment
noahrc Posted December 5, 2013 Share Posted December 5, 2013 Awesome workflow! I changed my shortcut in the workflow to show Alfred instead of passing through, so I can add a description to the selected text, if needed Link to comment
40-02 Posted March 16, 2014 Share Posted March 16, 2014 Awesome workflow! I changed my shortcut in the workflow to show Alfred instead of passing through, so I can add a description to the selected text, if needed Can you share it please? Link to comment
noxoc Posted June 27, 2014 Share Posted June 27, 2014 Awesome Workflow! I duplicated it several times for different boards. I have e.g: "prello" (private) and "wrello" (board I share with my co-worker). Link to comment
tjhils Posted January 23, 2015 Share Posted January 23, 2015 Is there any way to switch the order of the variables? For example trello <title>; <desc>; <list>; <date>; It's a small thing but it'd really speed me up. Link to comment
jmieczkowski Posted February 8, 2015 Share Posted February 8, 2015 Is there any way to switch the order of the variables? For example trello <title>; <desc>; <list>; <date>; It's a small thing but it'd really speed me up. I just did that. You need to change numbers in square brackets in lines 25 and 27 in the 'script.php' file. Something like that: http://bit.ly/1xQsmds Works great. Link to comment
politicus Posted February 16, 2015 Share Posted February 16, 2015 Great workflow. Thanks for sharing! Unable to make the list selection work. My message always goes to the first list of the board. Link to comment
jmieczkowski Posted February 17, 2015 Share Posted February 17, 2015 (edited) Unable to make the list selection work. My message always goes to the first list of the board. Please remember about the upper-/lower-case and don't put any spaces after the semicolon. e.g.: trello A New Card;With Description;Today Works for me. Edited February 17, 2015 by Jacek Link to comment
politicus Posted February 18, 2015 Share Posted February 18, 2015 @Jacek Thanks a lot! You are right. Apparently, spaces after semicolons were the problem. Github documentation should mention spaces prevent the workflow to work correctly. Link to comment
jfeemster Posted March 24, 2015 Share Posted March 24, 2015 (edited) I am new to Alfred and this site. I have the 'Alfred' v2 and' Alfred for Trello' v1.5 releases running on Mac OS X Yosemite. I created a public Trello workflow and then installed 'Alfred for Trello'as instructed. The instructions currently state that one should select the "jello" button to setup the connection and receive the "token". Unfortunately that didn't work as expected. In fact, nothing was reported in the Notification window or elsewhere. I thought I saw a notice of an incompatibility with Notification (although it was partially blocked when I looked again), so I installed Growl and changed the preferences accordingly. Still nothing was reported when I again selected the "jello" button. Without the token I am unable to proceed with the configuration of 'Alfred for Trello' so now I am here. Any suggestions as to how I should proceed? Edited March 24, 2015 by jfeemster Link to comment
brunozanardo Posted March 24, 2015 Share Posted March 24, 2015 Hello Miko, great workflow! I'm with a problem on autorization. When I type "jello" i go to the Trello website and don't give me the code. What's wrong? Tnks so much! Link to comment
Andrew Posted March 29, 2015 Share Posted March 29, 2015 If both of you are getting the same issue, the Trello API may have changed? Can anybody shed any light on this for these guys? (I don't use Trello) Link to comment
macbikegeek Posted June 25, 2016 Share Posted June 25, 2016 @Miko, thanks for this it's working great with Alfred v3 and adding cards to Trello running as a Fluid app. Perfect for my workflow. Link to comment
chcameron Posted March 30, 2017 Share Posted March 30, 2017 I'm trying to use this workflow and yesterday I was using it just fine. However today I'm getting an error. Quote Warning: Invalid argument supplied for foreach() ... The warning goes on to list a filepath but it's so long I can't see the actual end of the path, but my guess is it's pointing to the php file in the workflow folder. Here's that file's contents (see line 44 for the "foreach()"): <?php /* -------------------------------------------------------------------------------------- Script: Trello for Alfred Author: Tom Longo Contributors: Miko Magni, cokeby190 Usage: trello <Card name>;<Card description>;<Label>;<Due Date>;<List Name> Desc: Adds card to trello Updated: 20/11/14 ----------------------------------------------------------------------------------------- */ // API KEY: 1433c6977ccb78cd82e29a5455a24815 // https://trello.com/1/connect?key=[API_KEY]&name=[APP_NAME]&response_type=token&scope=read,write&expiration=never // https://trello.com/1/connect?key=1433c6977ccb78cd82e29a5455a24815&name=Trello%20for%20Alfred&response_type=token&scope=read,write&expiration=never $trello_key = '1433c6977ccb78cd82e29a5455a24815'; $trello_api_endpoint = 'https://api.trello.com/1'; $trello_list_id = false; $data = explode( ";", $argv[1] ); $trello_member_token = $data[0]; $trello_board_id = $data[1]; $name = (isset($data[2])) ? stripslashes(trim($data[2])) : 'Untitled card'; $desc = (isset($data[3])) ? stripslashes(trim($data[3])) : ''; $labels = (isset($data[4])) ? stripslashes(trim($data[4])) : ''; $due = (isset($data[5])) ? stripslashes(trim($data[5])) : ''; $list_name = (isset($data[6])) ? stripslashes(trim($data[6])) : ''; $position = (isset($data[7])) ? stripslashes(trim($data[7])) : 'bottom'; $url = "{$trello_api_endpoint}/boards/{$trello_board_id}?lists=open&list_fields=name&fields=name,desc&key={$trello_key}&token={$trello_member_token}"; $ch = curl_init(); // Set query data here with the URL curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, '25'); $content = trim(curl_exec($ch)); curl_close($ch); $board = json_decode($content); $lists = $board->lists; $trello_list_id = $lists[0]->id; foreach($lists as $list) { if($list->name == $list_name) { $trello_list_id = $list->id; } } if($trello_list_id) { $ch = curl_init("$trello_api_endpoint/cards"); curl_setopt_array($ch, array( CURLOPT_SSL_VERIFYPEER => false, // Probably won't work otherwise CURLOPT_RETURNTRANSFER => true, // So we can get the URL of the newly-created card CURLOPT_POST => true, CURLOPT_POSTFIELDS => http_build_query(array( // if you use an array without being wrapped in http_build_query, the Trello API server won't recognize your POST variables 'key' => $trello_key, 'token' => $trello_member_token, 'name' => $name, 'desc' => $desc, 'labels' => $labels, 'due' => $due, 'idList' => $trello_list_id, 'pos' => $position )), )); $result = curl_exec($ch); $trello_card = json_decode($result); echo ($trello_card->url) ? '"'.$name.'" added.' : 'Error adding card.'; } else { echo 'List not found'; } This morning I updated Mac OS with some small patch, and am currently on Sierra 10.12.4 ... my guess is something in this update broke something? Maybe? Any help here? Link to comment
Miko Posted April 25, 2018 Author Share Posted April 25, 2018 On 3/31/2017 at 12:51 AM, chcameron said: I'm trying to use this workflow and yesterday I was using it just fine. However today I'm getting an error. I have just posted an update that should fix your problem. Please make sure to delete the old version before installing the new Trello Workflow. Follow the installation instructions and generate your API KEY and Token. Thanks, Miko Link to comment
Miko Posted May 21, 2018 Author Share Posted May 21, 2018 Hi Gabrielle, Did you generate your Trello Developer API Key and then authorised the workflow to work with Trello and entered the correct Board ID? The only way that I was able to replicate the error was by entering the credential incorrectly. Make sure that each preference in the bash file is within '' example below key='00000000000' token='0000000000000000000000000000000' boardid='0000000' Link to comment
Absynth Posted May 27, 2018 Share Posted May 27, 2018 This is absolutely awesome! Juste something that would be nice to have is to be able to get back the whole instruction in case of error (it does happen a lot for me)... What do you think of that @Miko? Once again: nice job! Link to comment
gamell Posted August 14, 2018 Share Posted August 14, 2018 First of all, thanks to @Miko and co. for this amazing workflow. Just wanted lo let you all know that I made a small change to it to allow users to set defaults via environment variables for List, Label, Due date and Position. So, for example, if you want to always create your cards in the same list as I do, you can set it once and forget it. If you pass any list via the query, that will override the default as expected. You can find this version here. And I also opened a Pull Request to get this functionality in the original workflow by @Miko , which also has some instructions as to how to set the defaults. Thanks!! Miko 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now