Skip to content

Commit

Permalink
prepare for JENKINS-6110
Browse files Browse the repository at this point in the history
  • Loading branch information
kreyssel authored and kohsuke committed Jun 15, 2011
1 parent a022864 commit 65c1611
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 18 deletions.
11 changes: 11 additions & 0 deletions JIRA plugin idea.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ perhaps add a tab to issue, listing related builds?

JIRA Wiki formatting rules:
http://localhost:90/secure/WikiRendererHelpAction.jspa?section=texteffects

JIRA Support for Workflow Actions
- you can have multiple separated worflows in you jira installation
http://www.atlassian.com/software/jira/tour/workflow.jsp
- issues has binding to one workflow
- workflow steps has one or more transition actions to go to another workflow step
- workflow actions can have role bindings
- every workflow action has a unique id
- workflow actions has binded "actions fields" that be shown as a subscreen if you call the action
- this action fields can be optional or required

19 changes: 19 additions & 0 deletions src/test/java/JiraConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import java.util.ResourceBundle;

public final class JiraConfig {

private static final ResourceBundle CONFIG = ResourceBundle
.getBundle("jira");

public static String getUrl() {
return CONFIG.getString("url");
}

public static String getUsername() {
return CONFIG.getString("username");
}

public static String getPassword() {
return CONFIG.getString("password");
}
}
66 changes: 48 additions & 18 deletions src/test/java/JiraTester.java
Original file line number Diff line number Diff line change
@@ -1,32 +1,62 @@
import hudson.plugins.jira.soap.JiraSoapService;
import hudson.plugins.jira.soap.JiraSoapServiceService;
import hudson.plugins.jira.soap.JiraSoapServiceServiceLocator;
import hudson.plugins.jira.soap.RemoteField;
import hudson.plugins.jira.soap.RemoteIssue;
import hudson.plugins.jira.soap.RemoteNamedObject;
import hudson.plugins.jira.soap.RemoteProject;
import hudson.plugins.jira.soap.RemoteStatus;

import java.net.URL;

/**
* Test bed to play with JIRA.
*
*
* @author Kohsuke Kawaguchi
*/
public class JiraTester {
public static void main(String[] args) throws Exception {
JiraSoapServiceService jiraSoapServiceGetter = new JiraSoapServiceServiceLocator();

JiraSoapService service = jiraSoapServiceGetter.getJirasoapserviceV2(
new URL("http://issues.apache.org/jira/rpc/soap/jirasoapservice-v2"));
String token = service.login("kohsuke", "kohsuke");

// key can be used.
RemoteProject[] projects = service.getProjectsNoSchemes(token);
for (RemoteProject p : projects) {
System.out.println(p.getKey());
}

RemoteIssue issue = service.getIssue(token, "JENKINS-1");
System.out.println(issue);
issue.getSummary(); // gives you title of the issue
}
public static void main(String[] args) throws Exception {
JiraSoapServiceService jiraSoapServiceGetter = new JiraSoapServiceServiceLocator();

JiraSoapService service = jiraSoapServiceGetter
.getJirasoapserviceV2(new URL(JiraConfig.getUrl()));
String token = service.login(JiraConfig.getUsername(),
JiraConfig.getPassword());

// key can be used.
// RemoteProject[] projects = service.getProjectsNoSchemes(token);
// for (RemoteProject p : projects) {
// System.out.println(p.getKey());
// }

String issueId = "TESTPROJEKT-60";
String actionId = "21";

RemoteIssue issue = service.getIssue(token, "TESTPROJEKT-61");
System.out.println("Issue Status: " + issue.getStatus());

RemoteNamedObject[] actions = service.getAvailableActions(token,
issueId);
for (RemoteNamedObject action : actions) {
System.out.println("Action: " + action.getId() + " - "
+ action.getName());
}

RemoteField[] actionFields = service.getFieldsForAction(token, issueId,
actionId);
for (RemoteField actionField : actionFields) {
System.out.println("ActionField: " + actionField.getId() + " - "
+ actionField.getName());
}

RemoteField[] customFields = service.getCustomFields(token);
for(RemoteField field:customFields){
System.out.println("Field: "+field.getId() + " - "+field.getName());
}

RemoteIssue updatedIssues = service.progressWorkflowAction(token,
issueId, actionId, null);
System.out.println("Issue Status: " + updatedIssues.getStatus());

}
}
3 changes: 3 additions & 0 deletions src/test/resources/jira.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
url=http://host/jira/rpc/soap/jirasoapservice-v2
username=user
password=passwd

0 comments on commit 65c1611

Please sign in to comment.