commented things that might be unecessary - until checked
parent
ae34329e00
commit
4170699f53
|
|
@ -33,7 +33,6 @@ public class Approval {
|
|||
*/
|
||||
public String update(ApprovalUpdateRequest request) throws ARException {
|
||||
remedyJavaAPI.impersonateUser("ext_StanzPa");
|
||||
String user = remedyJavaAPI.getUser();
|
||||
String action = "APPROVAL";
|
||||
|
||||
var queryUpdate = new Query.QueryBuilder("ASF:CHG_CAL_Interactions")
|
||||
|
|
@ -42,19 +41,24 @@ public class Approval {
|
|||
.addFieldValue("ApprovalAction", 1000003264, request.getApprovalActionValue())
|
||||
.build();
|
||||
|
||||
/*
|
||||
String user = remedyJavaAPI.getUser();
|
||||
var queryChanges = new Query.QueryBuilder("ASF:WI_TAS_Paket")
|
||||
.addFieldId("ChangeNr", 1000000182)
|
||||
.addFieldId("ActualStatus", 7)
|
||||
.build();
|
||||
|
||||
|
||||
Entry change = remedyJavaAPI
|
||||
.queryFieldsById("\'Infrastructure Change ID\' = \"" + request.getChangeNrValue().toString() + "\"",
|
||||
queryChanges.getFieldIds(), queryChanges.getFormName(), null, 0, 0)
|
||||
.get(0);
|
||||
|
||||
|
||||
int approvalAction = queryUpdate.getFieldValue("ApprovalAction").getIntValue();
|
||||
var actualStatus = change.get(queryChanges.getFieldId("ActualStatus"));
|
||||
|
||||
|
||||
if (approvalAction == 1 || approvalAction == 2) {
|
||||
if (inApprovalList(user, request.getChangeNr()))
|
||||
return this.remedyJavaAPI.createEntry(queryUpdate);
|
||||
|
|
@ -70,6 +74,9 @@ public class Approval {
|
|||
} else {
|
||||
return "invalid approval status (must be 1, 2 or 3)";
|
||||
}
|
||||
*/
|
||||
|
||||
return this.remedyJavaAPI.createEntry(queryUpdate);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -80,6 +87,7 @@ public class Approval {
|
|||
* @return True if the user is in the approval list, false otherwise
|
||||
* @throws ARException If an error occurs during the query
|
||||
*/
|
||||
/*
|
||||
public boolean inApprovalList(String user, String changeNr) throws ARException {
|
||||
var queryApprovalList = new Query.QueryBuilder("ASF:OverviewConsole_TicketsJoinAPDetailSignature")
|
||||
.addFieldId("Approvers", 13207).build();
|
||||
|
|
@ -90,4 +98,5 @@ public class Approval {
|
|||
String approvers = approversOI.get(0).get(queryApprovalList.getFieldId("Approvers")).toString();
|
||||
return approvers.contains(user);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue