@Override public String toString() { return getToStringHelper().toString(); }
System.out.println( String.format(FIELD_ROW_FORMAT, eachField.getName(), eachField.getId(), eachField.isRequired(), isCustom(eachField), eachField.getSchema().getType()));
if (eachEntry.getKey().equals(eachField.getId())) { try { final String attributeValue = eachEntry.getValue(); final Object mappedFieldValue = fieldMapFunctionCache.get(eachField.getSchema()).mapToFieldValue(eachField.getId(), eachField.getSchema(), attributeValue); builder.setFieldValue(eachField.getId(), mappedFieldValue); populatedFields.add(eachField.getId()); break; // we found a representation, now continue with next attribute } catch (Exception ex) { LOG.error("Could not convert attribute (id={}, value={}) to jira field value. Ignoring attribute.", eachField.getId(), eachEntry.getValue(), ex); final String missingFields = requiredFieldsNotSet.stream().map(f -> String.format("id: %s, name: %s", f.getId(), f.getName())).collect(Collectors.joining(", ")); LOG.warn("Not all required (custom) jira fields have been set. The following are unset: {}", missingFields);
private CimFieldInfo parseIssueFieldInfo(JSONObject json, String id) throws JSONException { final boolean required = json.getBoolean("required"); final String name = JsonParseUtil.getOptionalString(json, "name"); final FieldSchema schema = fieldSchemaJsonParser.parse(json.getJSONObject("schema")); final Set<StandardOperation> operations = parseOperations(json.getJSONArray("operations")); final Iterable<Object> allowedValues = parseAllowedValues(json.optJSONArray("allowedValues"), schema); final URI autoCompleteUri = JsonParseUtil.parseOptionalURI(json, "autoCompleteUrl"); return new CimFieldInfo(id, required, name, schema, operations, allowedValues, autoCompleteUri); }
GetCreateIssueMetadataOptions options = new GetCreateIssueMetadataOptionsBuilder() .withExpandedIssueTypesFields() .withProjectKeys("CGIM") .build(); List myList=(List) restClient.getIssueClient().getCreateIssueMetadata(options, pm); // getting the issue creation metadata relatively to the project im searching for java.util.Iterator<CimProject> it1=myList.iterator(); while(it1.hasNext()) { CimProject c=it1.next(); List issueT=(List) c.getIssueTypes(); // getting the list of issue types linked to this project java.util.Iterator<CimIssueType> it2=issueT.iterator(); while (it2.hasNext()) { CimIssueType issueType=it2.next(); System.out.print(issueType.getName()); Map<String, CimFieldInfo> fieldList=issueType.getFields(); // getting the list of fields linked to each issue type for(Entry<String, CimFieldInfo> entry : fieldList.entrySet()) { String cle = entry.getKey(); CimFieldInfo valeur = entry.getValue(); System.out.println(valeur.getName()); } } }
boolean found = false; for (Map.Entry<String, CimFieldInfo> entry : fieldInfoMap.entrySet()) { if (customField.equals(entry.getValue().getId())) { found = true; break;
System.out.println( String.format(FIELD_ROW_FORMAT, eachField.getName(), eachField.getId(), eachField.isRequired(), isCustom(eachField), eachField.getSchema().getType()));
if (eachEntry.getKey().equals(eachField.getId())) { try { final String attributeValue = eachEntry.getValue(); final Object mappedFieldValue = fieldMapFunctionCache.get(eachField.getSchema()).mapToFieldValue(eachField.getId(), eachField.getSchema(), attributeValue); builder.setFieldValue(eachField.getId(), mappedFieldValue); populatedFields.add(eachField.getId()); break; // we found a representation, now continue with next attribute } catch (Exception ex) { LOG.error("Could not convert attribute (id={}, value={}) to jira field value. Ignoring attribute.", eachField.getId(), eachEntry.getValue(), ex); final String missingFields = requiredFieldsNotSet.stream().map(f -> String.format("id: %s, name: %s", f.getId(), f.getName())).collect(Collectors.joining(", ")); LOG.warn("Not all required (custom) jira fields have been set. The following are unset: {}", missingFields);
private CimFieldInfo parseIssueFieldInfo(JSONObject json, String id) throws JSONException { final boolean required = json.getBoolean("required"); final String name = JsonParseUtil.getOptionalString(json, "name"); final FieldSchema schema = fieldSchemaJsonParser.parse(json.getJSONObject("schema")); final Set<StandardOperation> operations = parseOperations(json.getJSONArray("operations")); final Iterable<Object> allowedValues = parseAllowedValues(json.optJSONArray("allowedValues"), schema); final URI autoCompleteUri = JsonParseUtil.parseOptionalURI(json, "autoCompleteUrl"); return new CimFieldInfo(id, required, name, schema, operations, allowedValues, autoCompleteUri); }
boolean found = false; for (Map.Entry<String, CimFieldInfo> entry : fieldInfoMap.entrySet()) { if (customField.equals(entry.getValue().getId())) { found = true; break;
@Override public String toString() { return getToStringHelper().toString(); }