1
0
Fork 0

Merge pull request #3 from chaplinkyle/component-options

Add method to get allowed values for the components field for a given pr...
master
Kyle Chaplin 2013-09-11 13:29:01 -07:00
commit ae6ced8aa6
2 changed files with 24 additions and 0 deletions

3
.gitignore vendored
View File

@ -2,3 +2,6 @@
.*.swp
target/
work/
.classpath
.settings
.project

View File

@ -123,6 +123,27 @@ public class JiraClient {
);
return customFieldOptions;
}
/**
* Get a list of options for a components
*
* @param project Key of the project context
* @param issueType Name of the issue type
*
* @return a search result structure with results
*
* @throws JiraException when the search fails
*/
public List<Component> getComponentsAllowedValues(String project, String issueType) throws JiraException {
JSONObject createMetadata = (JSONObject) Issue.getCreateMetadata(restclient, project, issueType);
JSONObject fieldMetadata = (JSONObject) createMetadata.get(Field.COMPONENTS);
List<Component> componentOptions = Field.getResourceArray(
Component.class,
fieldMetadata.get("allowedValues"),
restclient
);
return componentOptions;
}
public RestClient getRestClient() {
return restclient;