use of com.atlassian.jira.rest.client.api.domain.IssueField in project staf by simpleworks-gmbh.
the class DebugTestFLOClientMojo method dumpIssue.
public void dumpIssue() {
final Issue issue = client.getIssue(testPlanId).claim();
DebugTestFLOClientMojo.logger.debug(String.format("key: '%s', issue: id: %d.", issue.getKey(), issue.getId()));
final IssueType type = issue.getIssueType();
DebugTestFLOClientMojo.logger.debug(String.format("issue type: id: %d, name: '%s'.", type.getId(), type.getName()));
final Status status = issue.getStatus();
DebugTestFLOClientMojo.logger.debug(String.format("status: id: %d, name: '%s'.", status.getId(), status.getName()));
DebugTestFLOClientMojo.dumpFields("fields for issue.", issue.getFields());
DebugTestFLOClientMojo.logger.debug("attachments:");
for (final Attachment attachment : issue.getAttachments()) {
DebugTestFLOClientMojo.logger.debug(String.format("attachment: '%s'.", attachment));
}
final IssueField field = issue.getField("Test Plan Iteration");
Assert.assertNotNull("field \"Test Plan Iteration\" can't be null.", field);
final Object obj = field.getValue();
DebugTestFLOClientMojo.logger.debug(String.format("class for field: \"Iteration\" is: '%s'.", obj.getClass().getName()));
{
DebugTestFLOClientMojo.logger.debug("transition:");
final Iterable<Transition> transitions = client.getTransitions(issue).claim();
for (final Transition transition : transitions) {
DebugTestFLOClientMojo.logger.debug(String.format("transition: name: '%s', id: %d.", transition.getName(), Integer.valueOf(transition.getId())));
}
}
for (final Subtask subtask : issue.getSubtasks()) {
final Issue i = client.getIssue(subtask.getIssueKey()).claim();
final IssueField steps = i.getFieldByName("Steps");
DebugTestFLOClientMojo.logger.debug(String.format("steps: '%s'.", steps.getValue()));
final IssueField template = i.getFieldByName("TC Template");
DebugTestFLOClientMojo.logger.debug(String.format("template: '%s'.", template.getValue()));
final Iterable<Transition> transitions = client.getTransitions(i).claim();
for (final Transition transition : transitions) {
DebugTestFLOClientMojo.logger.debug(String.format("subtask: '%s', transition: name: '%s', id: %d.", subtask.getIssueKey(), transition.getName(), Integer.valueOf(transition.getId())));
}
}
}
use of com.atlassian.jira.rest.client.api.domain.IssueField in project jira-plugin by jenkinsci.
the class JiraIssueParameterDefResultTest method prepareMocks.
@Before
public void prepareMocks() {
issueMock = mock(Issue.class);
IssueField fieldMock1 = mock(IssueField.class);
IssueField fieldMock2 = mock(IssueField.class);
IssueField fieldMock3 = mock(IssueField.class);
when(issueMock.getFieldByName("TestField1")).thenReturn(fieldMock1);
when(issueMock.getFieldByName("TestField2")).thenReturn(fieldMock2);
when(issueMock.getFieldByName("TestField3")).thenReturn(fieldMock3);
when(issueMock.getFieldByName("TestField4")).thenReturn(null);
when(issueMock.getSummary()).thenReturn("Summary");
when(fieldMock1.getValue()).thenReturn("Field1");
when(fieldMock2.getValue()).thenReturn("Field2");
when(fieldMock3.getValue()).thenReturn("");
}
use of com.atlassian.jira.rest.client.api.domain.IssueField in project mirrorgate-jira-stories-collector by BBVA.
the class JiraIssueUtils method getFieldValue.
private static Object getFieldValue(Issue issue, String field) {
Object out = null;
IssueField issueField = issue.getField(field);
if (issueField != null) {
out = issueField.getValue();
}
return out;
}
use of com.atlassian.jira.rest.client.api.domain.IssueField in project staf by simpleworks-gmbh.
the class TestFloUtils method getField.
public static String getField(final Issue issue, final String name) {
Assert.assertNotNull("issue can't be null.", issue);
Assert.assertFalse("name can't be null.", Convert.isEmpty(name));
final IssueField field = issue.getFieldByName(name);
Assert.assertNotNull(String.format("test case '%s': can't get field '%s'.", issue.getKey(), name), field);
Assert.assertNotNull(String.format("test case '%s': field '%s' without value.", issue.getKey(), name), field.getValue());
final String result = field.getValue().toString();
Assert.assertFalse(String.format("test case '%s': field '%s' has empty value.", issue.getKey(), name), Convert.isEmpty(result));
return result;
}
Aggregations