changed name of user to name of supportgroup
parent
19872e389d
commit
54deb83297
|
|
@ -76,19 +76,22 @@ public class SupportGroup {
|
||||||
* @throws ARException if an error occurs during the query
|
* @throws ARException if an error occurs during the query
|
||||||
*/
|
*/
|
||||||
public void queryUserSupportGroup(RemedyJavaAPI api) throws ARException {
|
public void queryUserSupportGroup(RemedyJavaAPI api) throws ARException {
|
||||||
var querySupportGroups = new Query.QueryBuilder("CTM:Support Group Association")
|
|
||||||
.addFieldId("SupportGroup", 1000000017)
|
|
||||||
.addFieldId("SupportGroupId", 1000000079)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
api.impersonateUser("ext_StanzPa");
|
api.impersonateUser("ext_StanzPa");
|
||||||
var supportGroupUser = api.queryFieldsById("\'Login ID\' = \"" + api.getUser() + "\"",
|
|
||||||
querySupportGroups.getFieldIds(), querySupportGroups.getFormName(), null, 0, 0);
|
|
||||||
|
|
||||||
var result = supportGroupUser.isEmpty() ? null : supportGroupUser.get(0);
|
var querySupportGroups = new Query.QueryBuilder("CTM:Support Group Association")
|
||||||
if (result != null) {
|
.addFieldId("SupportGroupId", 1000000079).build();
|
||||||
String supportGroupName = result.get(querySupportGroups.getFieldId("SupportGroup")).toString();
|
var supportGroupIdOfUser = api.queryFieldsById("\'Login ID\' = \"" + api.getUser() + "\"",
|
||||||
String supportGroupId = result.get(querySupportGroups.getFieldId("SupportGroupId")).toString();
|
querySupportGroups.getFieldIds(), querySupportGroups.getFormName(), null, 0, 0);
|
||||||
|
var id = supportGroupIdOfUser.isEmpty() ? null : supportGroupIdOfUser.get(0);
|
||||||
|
|
||||||
|
if (id != null) {
|
||||||
|
var supportGroupId = id.get(querySupportGroups.getFieldId("SupportGroupId")).toString();
|
||||||
|
var querySupportGroupName = new Query.QueryBuilder(formName).addFieldId("SupportGroupName", 1000000015)
|
||||||
|
.build();
|
||||||
|
var supportGroupNameOfUser = api.queryFieldsById("\'Support Group ID\' = \"" + supportGroupId + "\"",
|
||||||
|
querySupportGroupName.getFieldIds(), querySupportGroupName.getFormName(), null, 0, 0);
|
||||||
|
var supportGroupName = supportGroupNameOfUser.get(0)
|
||||||
|
.get(querySupportGroupName.getFieldId("SupportGroupName")).toString();
|
||||||
this.userSupportGroup = new SupportGroupGetResponse(supportGroupName, supportGroupId);
|
this.userSupportGroup = new SupportGroupGetResponse(supportGroupName, supportGroupId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue