@Override public String toString() { return Objects.toStringHelper(this). add("id", id). add("name", name). add("type", type). add("value", getValue()). toString(); }
@Override public String toString() { return MoreObjects.toStringHelper(this). add("id", id). add("name", name). add("type", type). add("value", getValue()). toString(); }
IssueField trigger = issue.getFieldByName("Trigger"); if (trigger != null) { JSONObject triggerJO = (JSONObject) trigger.getValue(); newIssue.setFieldValue(trigger.getId(), ComplexIssueInputFieldValue.with("value", triggerJO.get("value"))); }
private void setIssueStream(Issue issue, com.atlassian.jira.rest.client.api.domain.Issue jiraIssue) { try { IssueField jsonField = jiraIssue.getField(JSON_CUSTOM_FIELD + TARGET_RELEASE); if (jsonField == null || jsonField.getValue() == null) { return; } JSONObject value = (JSONObject) jsonField.getValue(); Map<String, FlagStatus> streamStatus; streamStatus = Collections.singletonMap(value.getString("name"), FlagStatus.ACCEPTED); issue.setStreamStatus(streamStatus); } catch (JSONException e) { LOG.error("error setting the stream in " + jiraIssue.getKey(), e); } }
private void setIssueSprintRelease(JiraIssue issue, com.atlassian.jira.rest.client.api.domain.Issue jiraIssue) { final IssueField issueField = jiraIssue.getFieldByName("Sprint"); if ( issueField != null && issueField.getValue() != null ) { JSONArray fieldValue = (JSONArray) issueField.getValue(); if ( fieldValue.length() > 0 ) issue.setSprintRelease(extractSprintName(fieldValue)); } }
private void setPullRequests(JiraIssue issue, com.atlassian.jira.rest.client.api.domain.Issue jiraIssue) { IssueField fieldContent = jiraIssue.getFieldByName("Git Pull Request");//Git Pull Request if ( fieldContent != null ) { extractPullRequests(issue, (JSONArray) fieldContent.getValue()); } }
private void setFlag(com.atlassian.jira.rest.client.api.domain.Issue jiraIssue, Stage stage, Flag flag, String fieldname) { if (jiraIssue.getField(fieldname) != null && jiraIssue.getField(fieldname).getValue() != null) stage.setStatus(flag, FlagStatus.getMatchingFlag((String) jiraIssue.getField(fieldname).getValue())); else { stage.setStatus(flag, FlagStatus.NO_SET); } }
private void updateStreamStatus(Issue issue, com.atlassian.jira.rest.client.api.domain.Issue jiraIssue, Map<String, Version> versionsMap, IssueInputBuilder inputBuilder) throws NotFoundException { String customField = JSON_CUSTOM_FIELD + TARGET_RELEASE; IssueField issueField = jiraIssue.getField(customField); if (issueField == null || (issueField.getType() == null && issueField.getValue() == null)) { String msg = String.format("Unable to set a stream status for issue %1$s as %2$s projects do not utilise field: %3$s", jiraIssue.getKey(), jiraIssue.getProject().getName(), customField); Utils.logWarnMessage(LOG, msg); return; } for (Map.Entry<String, FlagStatus> entry : issue.getStreamStatus().entrySet()) { if (entry.getValue() != FlagStatus.ACCEPTED) { String streamName = entry.getKey(); Version version = versionsMap.get(streamName); if (version != null) { inputBuilder.setFieldInput(new FieldInput(customField, ComplexIssueInputFieldValue.with("value", version.getId()))); } else { throw new NotFoundException("No Stream exists for this project with the name : " + streamName); } } } }