-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #81 - On starting a timer mark TP task as "In Progress", if current task state is "Open" or "Dev ready" #82
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,29 @@ export const start = async (packageVersion: string, apiProvider: ApiProvider, da | |
const notes = createNotes(noteInformation, [ details.notes ]); | ||
|
||
const harvestApi = apiProvider.getHarvestApi(); | ||
const targetprocessApi = apiProvider.getTargetprocessApi(); | ||
|
||
log.info("Starting Harvest timer..."); | ||
try { | ||
await harvestApi.startTimeEntry(details.projectId, details.taskId, date, notes, details.hours, details.running); | ||
|
||
// Issue #81: If the linked TP entity is a Task *and* its current state is 'Open' or 'Dev ready', set the task to 'In Progress' | ||
// Note: It is important to verify current state of Task, otherwise if a 'Done' task with time remaining is moved to 'In Progress', | ||
// it may increase the time on a story / feature which the dev / user might not realize as the task has moved to 'In Progress' by this utility | ||
// And if the time remaining has not reached 0, the task might not move to 'Done' when the timer is finished | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this flags the need for a wiki on this package given it is OSS, we should have things like this documented for visibility we can then reference documentation in the code if it is really necessary - for this case just documenting it should be enough I believe, then we can remove the comments. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
if (details.entity && | ||
details.entity.Id && | ||
details.entity.ResourceType === "Task" && | ||
details.entity.EntityState && | ||
details.entity.EntityState.Name && | ||
(details.entity.EntityState.Name.toUpperCase() === "OPEN" || | ||
details.entity.EntityState.Name.toUpperCase() === "DEV READY") && | ||
details.entity.Project && | ||
details.entity.Project.Process && | ||
details.entity.Project.Process.Id) { | ||
|
||
await targetprocessApi.setTaskState(details.entity.Id, "In Progress", details.entity.Project.Process.Id); | ||
} | ||
} catch (e) { | ||
log.error(e); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove this comment too as the issue will have a reference to this pr