def check_requirements_closed(issue ,close_date ,issues_w_requirements ,requirements_counter ,measurements ): """Check the specified closed issue for requirements that might also have been closed Args: issue - dictionary representing the issue to be checked close_date - date the issue was closed issues_w_requirements - collection of issue types that have requirements requirements_counter - counter object for requirements measurements - collection of measurements Returns: No return value """ reqmnt_cnt = get_requirement_cnt(issue['fields']['description'] ,issues_w_requirements ,issue['fields']['issuetype']['name']) if reqmnt_cnt > 0: requirements_counter.closed += reqmnt_cnt requirements_counter.open -= reqmnt_cnt ts = gen_timestamp(close_date) metadata = make_metadata(get_project(issue)) measurements.append(requirements_closed(reqmnt_cnt, ts, metadata))
def check_open_requirements(issue ,issues_w_requirements ,requirements_counter ,measurements ): """If the issue has requirements, adds to the open and total requirements counts Unfortunately, this evaluation is not strictly accurate, since they could have added the requirement any time after creation. However, short of walking backwards through the list of changes attempting to determine when requirements were added, we'll just look at the current state of the issue. Args: cfg_path - string containing the path to the configuration file Returns: No return value """ i_fields = issue['fields'] reqmnt_cnt = get_requirement_cnt(i_fields['description'] ,issues_w_requirements ,i_fields['issuetype']['name'] ) if reqmnt_cnt > 0: if GLOBALS['VERBOSE']: fstr = "Adding {0} requirements for: {1}" print(fstr.format(reqmnt_cnt, issue['key'])) requirements_counter.open += reqmnt_cnt requirements_counter.total += reqmnt_cnt ts = gen_timestamp(i_fields['created']) metadata = make_metadata(get_project(issue)) measurements.append(requirements_added(reqmnt_cnt, ts , metadata)) total = requirements_counter.total measurements.append(requirements_total(total, ts, metadata))