Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow reading the resolution property in Jira issues #504

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -120,16 +120,20 @@ JiraHost jiraHost() {
}

private static final Set<String> knownProperties = Set.of("issuetype", "fixVersions", "versions", "priority", "components");
private static final Set<String> readOnlyProperties = Set.of("resolution");

boolean isAllowedProperty(String name) {
boolean isAllowedProperty(String name, boolean forWrite) {
if (knownProperties.contains(name)) {
return true;
}
if (!forWrite && readOnlyProperties.contains(name)) {
return true;
}
return name.startsWith("customfield_");
}

Optional<JSONValue> decodeProperty(String name, JSONValue value) {
if (!isAllowedProperty(name)) {
if (!isAllowedProperty(name, false)) {
return Optional.empty();
}
if (value.isNull()) {
@@ -154,7 +158,7 @@ Optional<JSONValue> decodeProperty(String name, JSONValue value) {
}

Optional<JSONValue> encodeProperty(String name, JSONValue value) {
if (!isAllowedProperty(name)) {
if (!isAllowedProperty(name, true)) {
return Optional.empty();
}