@@ -0,0 +1,1328 @@
+import hudson.plugins.jira.soap.JiraSoapService;%0Aimport hudson.plugins.jira.soap.JiraSoapServiceService;%0Aimport hudson.plugins.jira.soap.JiraSoapServiceServiceLocator;%0Aimport hudson.plugins.jira.soap.RemoteComment;%0Aimport hudson.plugins.jira.soap.RemoteFieldValue;%0A%0Aimport java.net.URL;%0A%0A/**%0A * @author Kohsuke Kawaguchi%0A */%0Apublic class Foo %7B%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        JiraSoapServiceService jiraSoapServiceGetter = new JiraSoapServiceServiceLocator();%0A%0A        JiraSoapService service = jiraSoapServiceGetter.getJirasoapserviceV2(new URL(new URL(%22http://issues.hudson-ci.org/%22), %22rpc/soap/jirasoapservice-v2%22));%0A        String token = service.login(%22kohsuke%22,%22kohsuke%22);%0A        // if an issue doesn't exist an exception will be thrown%0A        service.getIssue(token, %22HUDSON-2916%22);%0A%0A        // add comment%0A        RemoteComment rc = new RemoteComment();%0A        rc.setBody(%22testing comment%22);%0A        service.addComment(token, %22HUDSON-2916%22, rc);%0A%0A        // resolve.%0A        // comment set here doesn't work. see http://jira.atlassian.com/browse/JRA-11278%0A        service.progressWorkflowAction(token,%22HUDSON-2916%22,%225%22 /*this is apparently the ID for %22resolved%22*/,%0A                new RemoteFieldValue%5B%5D%7Bnew RemoteFieldValue(%22comment%22,new String%5B%5D%7B%22closing comment%22%7D)%7D);%0A    %7D%0A%7D%0A

test program to make sure it works