Mercurial > public > JIRA
comparison ssdt-jira-plugins-v2/plugins/src/main/java/org/nwoca/ssdt/jira/RequireNoTimeRemainingValidator.java @ 2:4ca1ef5be75e
Added validators for Time tracking. New validator to require Time
Spent.
author | smith |
---|---|
date | Fri, 23 May 2008 18:06:10 -0400 |
parents | 56349dc044f5 |
children |
comparison
equal
deleted
inserted
replaced
1:56349dc044f5 | 2:4ca1ef5be75e |
---|---|
6 * To change this template, choose Tools | Template Manager | 6 * To change this template, choose Tools | Template Manager |
7 * and open the template in the editor. | 7 * and open the template in the editor. |
8 */ | 8 */ |
9 package org.nwoca.ssdt.jira; | 9 package org.nwoca.ssdt.jira; |
10 | 10 |
11 import com.atlassian.jira.ManagerFactory; | |
12 import com.atlassian.jira.issue.CustomFieldManager; | |
13 import com.atlassian.jira.issue.Issue; | 11 import com.atlassian.jira.issue.Issue; |
14 import com.atlassian.jira.issue.IssueUtils; | 12 import com.atlassian.jira.issue.IssueUtils; |
15 import com.atlassian.jira.issue.fields.CustomField; | |
16 import com.opensymphony.module.propertyset.PropertySet; | 13 import com.opensymphony.module.propertyset.PropertySet; |
17 import com.opensymphony.workflow.InvalidInputException; | 14 import com.opensymphony.workflow.InvalidInputException; |
18 import com.opensymphony.workflow.Validator; | 15 import com.opensymphony.workflow.Validator; |
19 import com.opensymphony.workflow.WorkflowException; | 16 import com.opensymphony.workflow.WorkflowException; |
20 import java.util.ArrayList; | |
21 import java.util.List; | |
22 import java.util.Map; | 17 import java.util.Map; |
23 | 18 |
24 /** | 19 /** |
25 * Requires zero time remaining if the issue has Time Tracking. Can use | 20 * Requires zero time remaining if the issue has Time Tracking. Can use |
26 * during resolve step. | 21 * during resolve step. |
27 * | 22 * |
28 * @author SMITH | 23 * @author SMITH |
29 */ | 24 */ |
30 public class RequireNoTimeRemainingValidator implements Validator { | 25 public class RequireNoTimeRemainingValidator implements Validator { |
31 | 26 |
32 private final List<CustomField> cfs = new ArrayList<CustomField>(); | 27 // private final List<CustomField> cfs = new ArrayList<CustomField>(); |
33 | 28 |
34 /** | 29 /** |
35 * Creates a new instance of RequireDocumentIssueValidator. | 30 * Creates a new instance of RequireDocumentIssueValidator. |
36 */ | 31 */ |
37 public RequireNoTimeRemainingValidator() { | 32 public RequireNoTimeRemainingValidator() { |
38 CustomFieldManager cfm = ManagerFactory.getCustomFieldManager(); | 33 // CustomFieldManager cfm = ManagerFactory.getCustomFieldManager(); |
39 for (Object obj : cfm.getCustomFieldObjects()) { | 34 // for (Object obj : cfm.getCustomFieldObjects()) { |
40 CustomField cf = (CustomField) obj; | 35 // CustomField cf = (CustomField) obj; |
41 if (!cf.getName().contains("Message")) { | 36 // if (!cf.getName().contains("Message")) { |
42 cfs.add(cf); | 37 // cfs.add(cf); |
43 System.out.println("Custom Field: " + cf.getName()); | 38 // System.out.println("Custom Field: " + cf.getName()); |
44 } | 39 // } |
45 | 40 // |
46 } | 41 // } |
47 | 42 |
48 } | 43 } |
49 | 44 |
50 public void validate(Map transientVars, Map args, PropertySet ps) | 45 public void validate(Map transientVars, Map args, PropertySet ps) |
51 throws InvalidInputException, WorkflowException { | 46 throws InvalidInputException, WorkflowException { |