Dive into secure and efficient coding practices with our curated list of the top 10 examples showcasing 'jira-client' in functional components in JavaScript. Our advanced machine learning engine meticulously scans each line of code, cross-referencing millions of open source libraries to ensure your implementation is not just functional, but also robust and secure. Elevate your React applications to new heights by mastering the art of handling side effects, API calls, and asynchronous operations with confidence and precision.
return this.config.init( this.configFileName ).then(function( r ){
let options = r;
if (r.proxy) {
const proxiedRequest = request.defaults({ proxy: r.proxy });
options = Object.assign({}, r, { request: proxiedRequest });
}
// Connect to Jira
_self.api = new JiraApi( options );
});
}
this.ticketPromises = {};
const { host, username, password} = config.jira.api;
let { email, token } = config.jira.api;
if (!token && typeof password !== 'undefined') {
console.warn('WARNING: Jira password is deprecated. Use an API token instead.');
token = password
}
if (!email && typeof username !== 'undefined') {
console.warn('WARNING: Jira username is deprecated for API authentication. Use user email instead.');
email = username
}
if (config.jira.api.host) {
this.jira = new JiraApi({
host,
username: email,
password: token,
protocol: 'https',
apiVersion: 2,
strictSSL: true
});
} else {
console.error('ERROR: Cannot configure Jira without a host configuration.');
}
}
constructor(config) {
JiraService.validateConfig(config);
const { host, username, password } = config;
this.jira = new JiraApi({
protocol: 'https',
host,
username,
password,
apiVersion: '2',
strictSSL: true,
});
this.statusCategory = {
inProgress: ['In Progress', 'In Development'],
selectedForDev: ['Selected for Development'],
readyForQA: ['Ready for QA', 'Ready for QA (Stage)', 'Ready for QA (Testsystem)'],
};
}