org.cert.cc.jira
Class JIRAHelpers

java.lang.Object
  extended by org.cert.cc.jira.JIRAHelpers

public final class JIRAHelpers
extends Object

JIRAHelpers contains static help methods

© 2012 Carnegie Mellon University

Author:
Steve Scholnick

Constructor Summary
JIRAHelpers()
           
 
Method Summary
static String dateDifference(long dateA, long dateB, long resolution)
           
static String datePrettyPrint(long difference, long resolution)
           
static Timestamp getClosed(Issue issue, JiraAuthenticationContext authenticationContext)
          Method to return a TimeStamp for the last time the Issue was closed.
static Long getTimeIgnoreWeekends(Long startTime, Long endTime)
          Method to determine the amount of time in millis between to times dates given in Millis.
static HashSet<String> getUsers(List<String> users, List<String> groupStrings)
          Obtains all of the users in the Jira Instance.
static String updateCustomFieldOnIssue(CustomField cf, MutableIssue issue, String value)
          This will correctly set a single custom value field on a mutable issue that has not been persisted yet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JIRAHelpers

public JIRAHelpers()
Method Detail

getUsers

public static HashSet<String> getUsers(List<String> users,
                                       List<String> groupStrings)
Obtains all of the users in the Jira Instance. It then does a logical OR of whether the user exists in the provided users list or the group list. If so they are added to the return.

Parameters:
users - - List String of users to include if they exist in the system.
groupStrings - - List String of groups to check for membership to include users.
Returns:
- HashSet String OR'd Users hash.

getTimeIgnoreWeekends

public static Long getTimeIgnoreWeekends(Long startTime,
                                         Long endTime)
Method to determine the amount of time in millis between to times dates given in Millis. This excludes weekends.

Parameters:
startTime - - Long
endTime - - Long
Returns:
Long

getClosed

public static Timestamp getClosed(Issue issue,
                                  JiraAuthenticationContext authenticationContext)
Method to return a TimeStamp for the last time the Issue was closed.

Parameters:
issue - - Issue to inspect.
Returns:
- TimeStamp representing the last time the issue was closed. Null if it has never been closed.

dateDifference

public static String dateDifference(long dateA,
                                    long dateB,
                                    long resolution)
Parameters:
dateA -
dateB -
resolution -
Returns:

datePrettyPrint

public static String datePrettyPrint(long difference,
                                     long resolution)
Parameters:
difference -
resolution -
Returns:

updateCustomFieldOnIssue

public static String updateCustomFieldOnIssue(CustomField cf,
                                              MutableIssue issue,
                                              String value)
This will correctly set a single custom value field on a mutable issue that has not been persisted yet. Primary use for this method would be during creation of a brand new issue with custom fields.

Parameters:
cf - - {@link CustomField)
issue - - MutableIssue
value - - String value to put into the custom field.


Copyright © 2012 Carnegie Mellon University