我在多个地点都有可以解决的多个问题。根据位置和问题,票证将被路由到特定技术。我不确定如何向多个技术人员查询或过滤多个位置,多个问题。示例:位置1,计算机问题,已发送给计算机技术人员。位置1,接线问题,已发送给接线技术人员。
答案 0 :(得分:0)
以下是此解决方案(GIF)的作用: Assign Issues to Techs
首先,您需要设置与模型的关系,以便可以按过滤器进行查询并将问题按类型和位置“分配”给Techs。您的模型关系如下所示:
一个问题到一个位置
一项技术
然后您创建问题,并将位置和技术与Forms小部件相关联。 如果要根据条件自动将问题分配给技术人员,则必须用另一个功能替换“表单”按钮上的默认“创建新项目” onClick功能。您可以使用客户端脚本或服务器脚本更改关联。请参阅文档here。试试我制作的这个客户端脚本:
function createAssignIssuePublic(){
// Datasources declaration
var issuesDatasource = app.datasources.Issues;
var locationDatasource = app.datasources.Locations;
// Creates an Issue item(record) and after it's finished a Tech is associated to it.
// Notice the callback function.
issuesDatasource.createItem(function(record){
var techsDatasource = app.datasources.Techs;
// Create a query.
var techsQuery = techsDatasource.query;
var issue = issuesDatasource.item;
var location = issue.Location.Name;
// Setting the conditionals to assign Tech per issue and location
if (issue.Type == "Computer issue"){
// Query by filter (name equals)
techsQuery.filters.Name._equals = "Computer Tech";
// Reloads Tech datasource per previous query filter.
// Once loaded, it relates the tech item to the issue item/record.
techsDatasource.load(function(){
var relatedTech = techsDatasource.item;
// Changes the Associated Tech
record.Tech = relatedTech;
});
}
// If issue is "Wiring issue" but NOT in a "Critical Location"
else if (issue.Type == "Wiring issue" && location !== "Critical Location"){
techsQuery.filters.Name._equals = "Wiring Tech";
techsDatasource.load(function(){
var relatedTech = techsDatasource.item;
record.Tech = relatedTech;
});
}
// If issue is "Wiring issue" but IN in a "Critical Location"
else if (issue.Type == "Wiring issue" && location == "Critical Location"){
techsQuery.filters.Name._equals = "Tech Lead";
techsDatasource.load(function(){
var relatedTech = techsDatasource.item;
record.Tech = relatedTech;
});
}
else{} });}
使上一张表显示所选技术人员所遇到的问题的原因是,下拉窗口小部件的值为@datasources.Issues.query.filters.Tech._equals
,并重新加载了Issues数据源onValueChange。