I am trying to write a little script to update cards with the amount of time the card has been on the list it is currently on, so we can optimize our throughput. I wrote a little script on jsfiddle that almost works, but I'm getting a "unauthorized card permission requested" when trying to use:
Trello.post("cards/" + card.id + "/actions/comments", {text: "This card has been in this list for " + ago + " days."})
or...
Trello.put("cards/" + card.id + "/name", "(" + ago + ") " + card.name);
Here is the fiddle, if that helps: http://jsfiddle.net/A3Xgk/2/
Any ideas? Thanks!
Try request your app token from https://trello.com/1/connect?key=yourkey&name=your_board_name&expiration=never&response_type=token&scope=read,write
reference: https://github.com/zmilojko/git-trello
The "unauthorized card permission" that is being requested is the write permission
In your jsfiddle example, when the "Connect to Trello" window pops up, you'll notice it says
The app will be able to:
- Read all of your boards and organizations
It won't be able to:
- Create and update cards, lists and boards
- Make comments for you
- Read your email address
- See your Trello password
You need to request a token that has write permissions, which you can do by changing the scope
parameter to Trello.authorize
:
$("#connectLink").click(function() {
Trello.authorize({
type: "popup",
scope: { read: true, write: true },
success: onAuthorize
});
});
(The default value for scope
in the source for client.js is { read: true, write: false }
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With