check if change in appr. list and right status
parent
64b0916970
commit
fd8e0ec91b
|
|
@ -141,7 +141,8 @@ public class Change {
|
||||||
.filter(peopleFullName::equals)
|
.filter(peopleFullName::equals)
|
||||||
.isPresent());
|
.isPresent());
|
||||||
try {
|
try {
|
||||||
var flag = inApprovalList(api.getUser(), getValueStringByID(entry, "ChangeNr"));
|
var inApproval = inApprovalList(api.getUser(), getValueStringByID(entry, "ChangeNr"));
|
||||||
|
var flag = Flag(inApproval, getValue(entry, "State").getIntValue());
|
||||||
change.setApprovalFlag(flag);
|
change.setApprovalFlag(flag);
|
||||||
} catch (ARException e) {
|
} catch (ARException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
@ -159,11 +160,17 @@ public class Change {
|
||||||
|
|
||||||
var approversOI = api.queryFieldsById("\'Ticketnumber\' = \"" + changeNr + "\"",
|
var approversOI = api.queryFieldsById("\'Ticketnumber\' = \"" + changeNr + "\"",
|
||||||
queryApprovalList.getFieldIds(), queryApprovalList.getFormName(), null, 0, 0);
|
queryApprovalList.getFieldIds(), queryApprovalList.getFormName(), null, 0, 0);
|
||||||
|
|
||||||
var approvers = !approversOI.isEmpty() ? approversOI.get(0).get(queryApprovalList.getFieldId("Approvers")).toString() : null;
|
var approvers = approversOI.isEmpty() ? null : approversOI.get(0).get(queryApprovalList.getFieldId("Approvers")).toString();
|
||||||
return approvers != null ? approvers.contains(user) : false;
|
return approvers != null ? approvers.contains(user) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean Flag(boolean approval, int status) {
|
||||||
|
boolean approvableStatus = (status == 1 || status == 10);
|
||||||
|
return approval && approvableStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link Value} of an entry based on the provided description.
|
* Returns the {@link Value} of an entry based on the provided description.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue