Open nlenzDE opened 3 years ago
Hi! I am glad someone else than my colleagues and me use this :D
The dependency vulnerabilities are not nice but should not interfere. You fixed them, so everything should be alright. What's missing is the src/config.js
file. You can use src/config.example.js
as template.
Jira: I addition to your Jira username and email, you will need a token: https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/ These data will be used to query your worklogs from Jira.
Kimai: URL to Kimai and your credentials are needed.
Mapping: Here Jira worklogs get assigned to Kimai tasks. To find the Kimai projectId and taskId you could check the kimai database, I guess. I always look into the kimai website: With the dev tools inspect the radio buttons where you usually choose the project or task. The ids are easily found in the DOM.
If you need any further help, please let me know!
Hi, thanks for the quick response. Yes, there was this issue with the config file that was not available.
Now being equipped with one I started over again:
[xxx@localhost Jimai]$ bash -x jimai.sh
- node ./src/index.js Date: 2021-04-29 (node:1587) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'join' of undefined at Promise (/home/xxx/other/Jimai/src/jira.js:11:103) at new Promise (
) at Object.getWorklogs (/home/xxx/other/Jimai/src/jira.js:9:10) at Object. (/home/xxx/other/Jimai/src/index.js:14:6) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) (node:1587) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:1587) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Here is the config.js file that has been used:
module.exports = { jira: { userName: '>>MYJIRAUSERNAME<<', email: '>>my@email.com<<', projects: ['>>OURJIRAPROJECT<<'], jiraAuth: { user: '>>MYJIRAUSERNAME<<', pass: '>>MYJIRATOKEN<<', sendImmediately: true } },
kimai: { api: 'https://<
>/json.php', auth: ['>>MYKIMAIUSERNAME<<', '>>MYKIMAITOKEN<<'] } }
Another question about https://github.com/Reynicke/Jimai/blob/master/src/jira.js, line 11:
const url = 'https://winedock.atlassian.net/rest/api/latest/search?expand=' + config.customFields.join(',');
-> shouldn't that be an individual URL as well?
Regards
Good catch with the jira URL! I'll add that to the config. Like I said, I hacked it together for my collegues.
Last thing missing in your config is the mapping.
You can now configure the Jira URL. Pull the new version and have a look in the config example.
Hi,
when doing
npm install
, this results in the following messages:I ran
npm audit fix --force
I then tried to start the script:
What do I need to solve that? I maybe
npm install
not enough?