Last active
April 26, 2019 10:04
-
-
Save hiiamyes/9f1e0bfdf6b091546d41a15e8fc32a00 to your computer and use it in GitHub Desktop.
jira-daily-standup.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require("axios"); | |
(async () => { | |
const assignee = "yes", | |
username = "", | |
password = ""; | |
const res = await axios.request({ | |
url: "https://emq-inc.atlassian.net/rest/api/3/search", | |
method: "post", | |
auth: { | |
username, | |
password | |
}, | |
data: { | |
expand: [], | |
jql: ` | |
project = CORE AND updatedDate > startOfDay() AND assignee changed from ${assignee} AFTER startOfDay() OR | |
project = CORE AND updatedDate > startOfDay() AND status in ("In Progress", "In Review", Test, Done) AND assignee = ${assignee} ORDER BY status ASC | |
`, | |
maxResults: 100, | |
fields: ["summary", "status"] | |
} | |
}); | |
dailyStanup = ""; | |
let status = ""; | |
res.data.issues.forEach( | |
({ | |
key, | |
fields: { | |
summary, | |
status: { name: statusName } | |
} | |
}) => { | |
if (status !== statusName) { | |
status = statusName; | |
dailyStanup += `\n${statusName}:\n`; | |
} | |
dailyStanup += `${key} ${summary}\n`; | |
} | |
); | |
const proc = require("child_process").spawn("pbcopy"); | |
proc.stdin.write(dailyStanup); | |
proc.stdin.end(); | |
console.log(dailyStanup); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment