FokkeZB/tickets — pull request #4 by manumaticx (2014-10-02 16:02:57+00:00)
Title: support multiple jiras

I added the functionality that I've requested in #2

It's actually a minor modification but let me explain why it's such a big diff:

I extracted the whole ticket-searching-process into a separate `jira`-method. If there's only one jira, this method gets called and does exactly the same thing as it did before. But if it's setup for multiple JIRAs it is able to repeat it for every jira configuration.

__Example:__

Your code has references to JIRA tickets in the appcelerator JIRA (_TIMOB-72554, ALOY-1151, etc._) __and__ tickets of your own / your companies JIRA (let's call it _https://my-company.atlassian.net/_) with project related tickets (e.g. _MYAPP-123, MYAPP-999, etc._). Then you can set it up like this:

```javascript
tickets({
dir: 'app',
jira: [
{
url: 'https://jira.appcelerator.org/',
keys: ['TIMOB', 'ALOY']
},{
url: 'https://my-company.atlassian.net/',
keys: ['MYAPP'],
username: 'myname',
password: 'mypassword'
}
]
}, function(err, issues){
// ..
});
```

What do you think?