Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Salesforce case to Trello #14

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
```javascript
javascript:(function(a){window.trelloAppKey="optional";window.trelloIdList="optional";var b=a.createElement("script");b.src="https://raw.github.com/danlec/Trello-Bookmarklet/master/trello_bookmarklet.js";a.getElementsByTagName("head")[0].appendChild(b)})(document);
javascript:(function(a){window.trelloAppKey="optional";window.trelloIdList="optional";var b=a.createElement("script");b.src="https://raw.github.com/palaniraja/Trello-Bookmarklet/master/trello_bookmarklet.js";a.getElementsByTagName("head")[0].appendChild(b)})(document);
```

This is a <a href="http://en.wikipedia.org/wiki/Bookmarklet">bookmarklet</a> you can use to create a card in <a href="https://trello.com">Trello</a> from ...

- FogBugz cases
- Salesforce cases - Copies Case subject as description or recent comment if exists.
- JIRA issues
- GitHub issues and commits
- The selected text from an arbitrary URL
Expand All @@ -31,4 +32,4 @@ and prepending `javascript:` to the front.

If you'd rather not add your appKey and idList for every new domain, you can modify the bookmarklet and include values for `window.trelloAppKey` and `window.trelloIdList` (currently both have the value `"optional"`)

**Note:** This basic concept originated with https://github.com/markdrago/cardorizer; this approach doesn't require you to run a server
**Note:** This basic concept originated with https://github.com/markdrago/cardorizer; this approach doesn't require you to run a server
10 changes: 9 additions & 1 deletion trello_bookmarklet.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
// We're looking at a redmine issue
name = $("#content h2:first").text().trim() + ": " + $("#content h3:first").text().trim();

} else if(desc.match(/salesforce.com\/500/)){
name = 'Case:' + $('h2.pageDescription').text().trim() + ' ' + $('td:contains(Subject)').closest('td').next().text().trim();

if($('span.listTitle:contains(Case Comments[0])').length != 1){
desc = $('td.dataCell').eq(0).text().trim() + '\n\n\n' + location.href;
}else{
desc = $('td:contains(Description)').closest('td').next().text().trim() + '\n\n\n' + location.href;
}
} else {

// It isn't anything we recognize, but we'll see if we can make something using the selected text
Expand Down Expand Up @@ -276,4 +284,4 @@
// Run the user portion
run
]);
})(window);
})(window);