-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#69 Create percent-complete function.
- Loading branch information
1 parent
72e3b3a
commit 972a191
Showing
3 changed files
with
146 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { JiraIssue, getIssueKey } from "../shared/issue-data/issue-data.js"; | ||
|
||
/** | ||
* @param { JiraIssue[] } issues | ||
* @param { PercentCompleteOptions } options | ||
*/ | ||
export function percentComplete(issues, options) { | ||
console.log(`percentComplete: issues=`, issues); | ||
console.log(`percentComplete: options=`, options); | ||
|
||
issues.forEach((issue) => { | ||
console.log(`percentComplete: issue='${getIssueKey(issue)}'`); | ||
}); | ||
} | ||
|
||
/** | ||
* @typedef PercentCompleteOptions | ||
* @property {(issue: JiraIssue) => string} getType | ||
* @property {(issue: JiraIssue) => string} getTeamKey | ||
* @property {(teamKey: string) => number} getDaysPerSprint | ||
* @property {(teamKey: string) => number} getVelocity | ||
* @property {(issue: JiraIssue) => number} getEstimate | ||
* @property {(issue: JiraIssue) => number} getConfidence | ||
* @property {(issue: JiraIssue) => string} getStartDate | ||
* @property {(issue: JiraIssue) => string} getDueDate | ||
* @property {number} uncertaintyWeight | ||
*/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/** | ||
* @param {JiraIssue} issue | ||
* @returns {number} | ||
*/ | ||
export function getConfidence({ fields }) { | ||
return fields.Confidence; | ||
} | ||
|
||
/** | ||
* @param {string} teamKey | ||
* @returns {number} | ||
*/ | ||
export function getDaysPerSprint(teamKey) { | ||
return 10; | ||
} | ||
|
||
/** | ||
* @param {JiraIssue} issue | ||
* @returns {string | null} | ||
*/ | ||
export function getDueDate({ fields }) { | ||
return fields["Due date"]; | ||
} | ||
|
||
/** | ||
* @param {JiraIssue} issue | ||
* @returns {number} | ||
*/ | ||
export function getEstimate({ fields }) { | ||
return fields["Story points median"]; | ||
} | ||
|
||
/** | ||
* @param {JiraIssue} issue | ||
* @returns {string} | ||
*/ | ||
export function getIssueKey({ key }) { | ||
return key; | ||
} | ||
|
||
/** | ||
* @param {JiraIssue} issue | ||
* @returns {string | null} | ||
*/ | ||
export function getStartDate({ fields }) { | ||
return fields["Start date"]; | ||
} | ||
|
||
/** | ||
* @param {JiraIssue} issue | ||
* @returns {string} | ||
*/ | ||
export function getTeamKeyDefault({ fields }) { | ||
var matches = fields.Summary.match(/M\d: ([^:]+): /); | ||
if (matches) { | ||
return fields["Project key"] + ":" + matches[1]; | ||
} else { | ||
return fields["Project key"]; | ||
} | ||
} | ||
|
||
/** | ||
* @param {JiraIssue} issue | ||
* @returns {string} | ||
*/ | ||
export function getType({ fields }) { | ||
return fields["Issue Type"].name; | ||
} | ||
|
||
/** | ||
* @param {string} teamKey | ||
* @returns {number} | ||
*/ | ||
export function getVelocity(teamKey) { | ||
return 21; | ||
} | ||
|
||
/** | ||
* @typedef {{ | ||
* fields: { | ||
* Confidence: number, | ||
* 'Due date': string | null, | ||
* 'Issue Type': { hierarchyLevel: number, name: string }, | ||
* 'Project Key': string, | ||
* 'Start date': string | null, | ||
* Status: { name: string } | ||
* 'Story points median'?: number, | ||
* Summary: string | ||
* }, | ||
* id: string, | ||
* key: string | ||
* }} JiraIssue | ||
*/ |
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