Created
January 6, 2012 05:41
-
-
Save j5ik2o/1569199 to your computer and use it in GitHub Desktop.
JIRA:初期見積もりが登録されているチケットの作業時間が未登録かどうかを判定するスクリプト
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
// サブタスクの作業時間を計算する | |
def subTasksTimeSpent(target) { | |
long result = 0 | |
subTasks = target.getSubTaskObjects() | |
for(subTask in subTasks){ | |
result += (subTask.getTimeSpent() == null ? 0 : subTask.getTimeSpent().floatValue()) | |
} | |
return result | |
} | |
// 初期見積もりが登録されている場合 | |
orgEst = issue.getOriginalEstimate() | |
if (orgEst != null && orgEst.floatValue() > 0) { | |
// 作業時間があるかどうか | |
timeSpent = issue.getTimeSpent() | |
if (timeSpent != null && timeSpent.floatValue() > 0){ | |
return true; | |
} else { | |
// ない場合は、サブタスクの時間を計算 | |
subTimeSpents = subTasksTimeSpent(issue) | |
if ( subTimeSpents > 0 ){ | |
return true | |
} | |
return false | |
} | |
} | |
return true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment