gsingers / slack-jira-plugin

A Slack plugin that watches channels for messages about JIRA and acts accordingly
MIT License
252 stars 85 forks source link

Unable to specify which project for which jira #6

Closed timfallmk closed 9 years ago

timfallmk commented 9 years ago

If you use multiple JIRA projects, there is no way to specify which projects map to one versus the other. All projects seem to default to the DEFAULT lira.

tjdownes commented 9 years ago

@timfallmk I discovered that the format of the config is incorrect. You need to use

jira_urls: {
        "DEFAULT": {
            url: 'https://url/browse/'
        },
//MATCHES PROJECT NAME
        "SOLS": {//OPTIONAL: provide access to jira credentials for a particular repository
//NOTE THE "jira" node
            jira: {
                user: 'user',
                password: 'password',
                host: 'host.net',
                protocol: 'https',
                port: 443,
                version: '2',
                verbose: true,
                strictSSL: true
            }
        }
    }
timfallmk commented 9 years ago

Does that allow you to set which project name maps to which endpoint?

tjdownes commented 9 years ago

Yep, the project name is the same as the node name. So in config.projects for me:

projects: ["SOLS", "CPQ"],
tjdownes commented 9 years ago

Also note that I found another bug. You need to add the URL property to those jira configs as well:

"SOLS": {//OPTIONAL: provide access to jira credentials for a particular repository
            url: 'https://url/browse/',
            jira: {
                user: 'user',
                password: 'password',
                host: 'host.net',
                protocol: 'https',
                port: 443,
                version: '2',
                verbose: true,
                strictSSL: true
            }
        }
gsingers commented 9 years ago

correct, there are two parts: the projects attribute in the config defines what regex to watch for in the message. The jira_urls define where to go lookup those matches.