- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi all.
I've been building a predictive intelligence Assignment Group Assigner
following Multi-Method Assignment Group Prediction with Now ... - ServiceNow Community
However the build of the Predictive Intelligence part is causing problems.
I have definitely selected the 'Solution Name' as I create the tool. and the solution definitely exists as I chose it from the dropdown when creating the tool.
However, when I run the tool I get the error:
"301: SolutionName is empty"
The 'request' appears to send a json object which includes the 'short_description' and the 'topnresults' but does not contain a 'SolutionName' field.
Should it.
If so how can I fix this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @MattStoodley , I ran into the exact same issue getting the 301: Solution Name is empty in the PI tool output. Searching for an answer I came across your question. Were you able to solve it? I'm about to open a case with support myself since this seems to be an issue with the Predictive Intelligence tool itself in Now Assist Skill kit since there is no configuration available besides just selecting the 'Solution label'.
As a work around to keep going, I instead opted to add an additional script tool and call the solution directly using the below script. This is working for me. Just replace with your solution name obviously.
(function runScript(context) {
var solutionName =
"ml_yoursolutionnamehere";
try {
var shortDescription =
context.getValue("incident.short_description") || "";
var description =
context.getValue("incident.description") || "";
var mlSolution =
sn_ml.MLSolutionFactory.getSolution(solutionName);
var response =
mlSolution.predict([{
short_description: shortDescription,
description: description
}], {
top_n: 3
});
var result = JSON.parse(response);
var predictions = result["1"] || [];
return JSON.stringify({
prediction_found: predictions.length > 0,
prediction_count: predictions.length,
predictions: predictions.map(function(p) {
return {
assignment_group: p.predictedValue || "",
assignment_group_sys_id: p.predictedSysId || "",
confidence: p.confidence || 0,
threshold: p.threshold || 0
};
})
});
} catch (e) {
return JSON.stringify({
prediction_found: false,
error: e.message
});
}
})(context);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @MattStoodley , I ran into the exact same issue getting the 301: Solution Name is empty in the PI tool output. Searching for an answer I came across your question. Were you able to solve it? I'm about to open a case with support myself since this seems to be an issue with the Predictive Intelligence tool itself in Now Assist Skill kit since there is no configuration available besides just selecting the 'Solution label'.
As a work around to keep going, I instead opted to add an additional script tool and call the solution directly using the below script. This is working for me. Just replace with your solution name obviously.
(function runScript(context) {
var solutionName =
"ml_yoursolutionnamehere";
try {
var shortDescription =
context.getValue("incident.short_description") || "";
var description =
context.getValue("incident.description") || "";
var mlSolution =
sn_ml.MLSolutionFactory.getSolution(solutionName);
var response =
mlSolution.predict([{
short_description: shortDescription,
description: description
}], {
top_n: 3
});
var result = JSON.parse(response);
var predictions = result["1"] || [];
return JSON.stringify({
prediction_found: predictions.length > 0,
prediction_count: predictions.length,
predictions: predictions.map(function(p) {
return {
assignment_group: p.predictedValue || "",
assignment_group_sys_id: p.predictedSysId || "",
confidence: p.confidence || 0,
threshold: p.threshold || 0
};
})
});
} catch (e) {
return JSON.stringify({
prediction_found: false,
error: e.message
});
}
})(context);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Thanks, Yes, I did solve it in basically the same way in the end. Thanks for documenting your answer, That'll save someone a lot of trouble.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @qprinsloo,
Regarding your solution, as I am experiencing the same error and new to NASK building, could you correct me if I'm wrong, but will I be creating a new Script Tool that would connect from the "fetchDetailsIncident" script tool, essentially having 4 tools that connect from it?
Much appreciate your assistance.
