Use Priority when Poll not set

This commit is contained in:
2024-10-17 15:28:29 -07:00
parent 07d08a9fbc
commit c0fdbad707
13 changed files with 405 additions and 28 deletions

View File

@ -75,13 +75,13 @@ function getPriority(workItemType, priority) {
return result;
}
function getPollValue(pollValue) {
function getPollValue(priority, pollValue) {
var result;
if (pollValue === undefined || pollValue.Records.length === undefined || pollValue.Records.length === 0)
result = "0-9-Unknown";
result = priority;
else {
if (pollValue.Average !== null)
result = "0-8-Not";
result = priority;
if (pollValue.Average > 2)
result = `${pollValue.Average}-1-${pollValue.Count}-High (Most Critical)`;
else if (pollValue.Average > 1)
@ -89,7 +89,7 @@ function getPollValue(pollValue) {
else if (pollValue.Average > 0)
result = `${pollValue.Average}-3-${pollValue.Count}-Low`;
else
result = "0-8-Not";
result = priority;
}
return result;
}
@ -120,8 +120,9 @@ function getWorkItems(data, dataB) {
workItem["ParentState"] = getState(parent["State"]);
}
workItem["State"] = getState(workItem["State"])
workItem["PollValue"] = getPollValue(dataB[workItem.Id]);
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
var priority = getPriority(workItem["WorkItemType"], workItem["Priority"])
workItem["Priority"] = priority;
workItem["PollValue"] = getPollValue(priority, dataB[workItem.Id]);
workItems.push(workItem);
}
workItems.sort(compareFunction);