Skip to content
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
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
.idea
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ jira: {
host: 'jira.yourdomain.com',
port: '',
user: jiraConfig.user,
password: jiraConfig.password
password: jiraConfig.password,
timeout: 10000 //optional timeout parameter, in ms
}
}
```
Expand Down Expand Up @@ -405,7 +406,7 @@ jira: {
}
}
```


## Credits
[[Back To Top]](#jump-to-section)
Expand All @@ -424,8 +425,9 @@ The result of this is that that version 0.2 and later are **not backwards compat
* 0.1.0 - Initial release by @shift
* 0.2.0 - Renewed release by @ronaldtreur (breaking)
* 0.2.1 - Empowered the *process* function and added documentation
* 0.2.2 - Updated `jira-client` support



--------
<small>_This readme has been automatically generated by [readme generator](https://github.com/aponxi/grunt-readme-generator) on Sun May 17 2015 18:39:20 GMT+0200 (CEST)._</small>
<small>_This readme has been automatically generated by [readme generator](https://github.com/aponxi/grunt-readme-generator) on Thu Jul 13 2017 16:40:24 GMT-0700 (PDT)._</small>
4 changes: 2 additions & 2 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jira: {
host: 'jira.yourdomain.com',
port: '',
user: jiraConfig.user,
password: jiraConfig.password
password: jiraConfig.password,
timeout: 10000 //optional timeout parameter, in ms
}
}
```
Expand Down Expand Up @@ -114,4 +115,3 @@ jira: {
}
}
```

3 changes: 2 additions & 1 deletion docs/releases.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* 0.1.* - Travis CI
* 0.1.0 - Initial release by @shift
* 0.2.0 - Renewed release by @ronaldtreur (breaking)
* 0.2.1 - Empowered the *process* function and added documentation
* 0.2.1 - Empowered the *process* function and added documentation
* 0.2.2 - Updated `jira-client` support
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-jira",
"description": "JIRA integration for Grunt",
"version": "0.2.1",
"version": "0.2.2",
"keywords": [
"grunt",
"gruntplugin",
Expand Down Expand Up @@ -32,7 +32,7 @@
}
],
"dependencies": {
"jira": "~0.9.2"
"jira-client": "^1.2.0"
},
"devDependencies": {
"grunt-readme-generator": "^0.3.41",
Expand Down
37 changes: 19 additions & 18 deletions tasks/jira.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT license.
*/

var JiraApi = require('jira').JiraApi,
var JiraApi = require('jira-client'),
util = require('util'),
commands = require('../lib/commands'),
requiredSettings = ['protocol', 'host', 'port', 'user', 'password'];
Expand Down Expand Up @@ -74,7 +74,7 @@ module.exports = function (grunt) {
for you, you can define a process-function in order to manipulate it.

A second use-case is when writing a value to Grunt's config is not your desired outcome. Perhaps you want to
write it to a file, or do other crazy things with it. You can do so in the process-function.
write it to a file, or do other crazy things with it. You can do so in the process-function.

Lastly, when the completed task was part of a task-chain (i.e. it was defined as an element of the
tasks-property), the function defined will also receive the (potentially processed) result-object of
Expand All @@ -97,7 +97,7 @@ module.exports = function (grunt) {
option.config (optional) - Either a String or a dictionary object.

The resulting object, returned by your Jira-command can be saved into Grunt's
configuration. This is helpful, because you can then use it / build on it using
configuration. This is helpful, because you can then use it / build on it using
other Grunt tasks.

Defining the config option as a string has the following effect:
Expand All @@ -112,13 +112,13 @@ module.exports = function (grunt) {

This will copy the complete result-object into Grunt's 'git.commit.issue'-config-property.

You can also specify a dictionary object, where the keys are the config-properties you want to set.
You can also specify a dictionary object, where the keys are the config-properties you want to set.
The value you specify for each of these keys, should be a string that depicts a property in Jira's
result-object that you want to assign to it.

This gives you more fine-grained control over what properties are assigned to what config-property, instead
of having to deal with the complete result-object down the line.

Example:
```
config: {
Expand All @@ -127,7 +127,7 @@ module.exports = function (grunt) {
}
```

This particular example will copy the issueNumber into both the *git.commit.issue* config,
This particular example will copy the issueNumber into both the *git.commit.issue* config,
as well as to the *prompt.issue.number*-config.
*/
if (task.config) {
Expand All @@ -146,7 +146,7 @@ module.exports = function (grunt) {
}

taskManager.passValueOn = result;

taskManager.lastResult = null;
done();
}
Expand Down Expand Up @@ -174,22 +174,23 @@ module.exports = function (grunt) {
return;
}

jira = new JiraApi(
options.protocol,
options.host,
options.port,
options.user,
options.password,
'2',
true
);
jira = new JiraApi({
protocol: options.protocol,
host: options.host,
port: options.port,
username: options.user,
password: options.password,
apiVersion: 2,
strictSSL: true,
timeout: options.timeout || 2000//in milliseconds
});

var taskNr = 0;

var next = function next(cont) {
if (cont !== false && taskNr < self.tasks.length) {
processTask(self.tasks[taskNr], options, jira, grunt, self, next);
taskNr++;
taskNr++;
} else {
done();
}
Expand All @@ -209,4 +210,4 @@ module.exports = function (grunt) {
function isPlainObject(value) {
return typeof value === 'object' && !util.isArray(value);
}
};
};