Package net.sf.json

Examples of net.sf.json.JSON


        return (JSONObject)jo.get("fields");
    }

    private JSONArray getTransitions() throws JiraException {
        JSON result = null;

        try {
            URI transuri = restclient.buildURI(
                getRestUri(key) + "/transitions",
                new HashMap<String, String>() {{
View Full Code Here


    }

    private static JSONObject realGet(RestClient restclient, String key, Map<String, String> queryParams)
            throws JiraException {

        JSON result = null;

        try {
            URI uri = restclient.buildURI(getBaseUri() + "issue/" + key, queryParams);
            result = restclient.get(uri);
        } catch (Exception ex) {
View Full Code Here

    public static SearchResult search(RestClient restclient, String jql,
            String includedFields, Integer maxResults, Integer startAt)
                    throws JiraException {

        final String j = jql;
        JSON result = null;

        try {
            Map<String, String> queryParams = new HashMap<String, String>() {
                {
                    put("jql", j);
View Full Code Here

    public List<WorkLog> getAllWorkLogs() throws JiraException {
        JSONObject obj;
        try {
            URI uri = restclient.buildURI(getRestUri(key) + "/worklog");
            JSON json = restclient.get(uri);
            obj = (JSONObject) json;
        } catch (Exception ex) {
            throw new JiraException("Failed to get worklog for issue "
                    + key, ex);
        }
View Full Code Here

            }

            JSONObject req = new JSONObject();
            req.put("fields", fieldmap);

            JSON result = null;

            try {
                result = restclient.post(getRestUri(null), req);
            } catch (Exception ex) {
                throw new JiraException("Failed to create issue", ex);
View Full Code Here

     * @throws JiraException when the retrieval fails
     */
    public static Priority get(RestClient restclient, String id)
        throws JiraException {

        JSON result = null;

        try {
            result = restclient.get(getBaseUri() + "priority/" + id);
        } catch (Exception ex) {
            throw new JiraException("Failed to retrieve priority " + id, ex);
View Full Code Here

     * @throws JiraException when the retrieval fails
     */
    public static Status get(RestClient restclient, String id)
        throws JiraException {

        JSON result = null;

        try {
            result = restclient.get(getBaseUri() + "status/" + id);
        } catch (Exception ex) {
            throw new JiraException("Failed to retrieve status " + id, ex);
View Full Code Here

     * @throws JiraException
     */
    public List<Priority> getPriorities() throws JiraException {
        try {
            URI uri = restclient.buildURI(Resource.getBaseUri() + "priority");
            JSON response = restclient.get(uri);
            JSONArray prioritiesArray = JSONArray.fromObject(response);

            List<Priority> priorities = new ArrayList<Priority>(prioritiesArray.size());
            for (int i = 0; i < prioritiesArray.size(); i++) {
                JSONObject p = prioritiesArray.getJSONObject(i);
View Full Code Here

     * @throws JiraException failed to obtain the project list.
     */
    public List<Project> getProjects() throws JiraException {
        try {
            URI uri = restclient.buildURI(Resource.getBaseUri() + "project");
            JSON response = restclient.get(uri);
            JSONArray projectsArray = JSONArray.fromObject(response);

            List<Project> projects = new ArrayList<Project>(projectsArray.size());
            for (int i = 0; i < projectsArray.size(); i++) {
                JSONObject p = projectsArray.getJSONObject(i);
View Full Code Here

     * @throws JiraException failed to obtain the project
     */
    public Project getProject(String key) throws JiraException {
        try {
            URI uri = restclient.buildURI(Resource.getBaseUri() + "project/" + key);
            JSON response = restclient.get(uri);
            return new Project(restclient, (JSONObject) response);
        } catch (Exception ex) {
            throw new JiraException(ex.getMessage(), ex);
        }
    }
View Full Code Here

TOP

Related Classes of net.sf.json.JSON

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.