View Javadoc

1   
2   package org.lsst.ccs.release.management;
3   
4   import org.json.JSONException;
5   import org.json.JSONObject;
6   
7   /**
8    * A class representing a Jira Issue.
9    * 
10   * @author The CCS LSST Team.
11   */
12  public class JiraIssue {
13      
14      private String typeIconUrl, key, summary, priorityIconUrl, status, resolution = "Unresolved";
15      
16      public JiraIssue(JSONObject jsonObj) throws JSONException {
17          
18          key = jsonObj.getString("key");
19          JSONObject fields = jsonObj.getJSONObject("fields");
20          summary = fields.getString("summary");
21          JSONObject type = fields.getJSONObject("issuetype");
22          typeIconUrl = type.getString("iconUrl");
23          try {
24              JSONObject relObject = fields.getJSONObject("resolution");
25              if ( relObject != null ) {
26                  resolution = relObject.getString("name");                
27              }
28          } catch (JSONException e) {};
29          
30          JSONObject priority = fields.getJSONObject("priority");
31          priorityIconUrl = priority.getString("iconUrl");
32          status = fields.getJSONObject("status").getString("name");
33      }
34  
35      public String getTypeIconUrl() {
36          return typeIconUrl;
37      }
38  
39      public String getKey() {
40          return key;
41      }
42  
43      public String getSummary() {
44          return summary;
45      }
46  
47      public String getPriorityIconUrl() {
48          return priorityIconUrl;
49      }
50  
51      public String getStatus() {
52          return status;
53      }
54  
55      public String getResolution() {
56          return resolution;
57      }
58      
59  }