Hi
We just upgrade to V7 and noticed our custom tasks which will update the action log stopped working.
I used this code before - in V5:
/*var newActionLog = {
EnteredBy: session.user.Name,
Title: localization.Analyst + " " + localization.Comment,
IsPrivate: this.isPrivate,
EnteredDate: new Date().toISOString(),
LastModified: new Date().toISOString(),
Description: this.actionLogComment,
DescriptionDisplay: this.actionLogComment,
Image: (this.isPrivate) ? app.config.iconPath + app.config.icons["privateComment"] : app.config.iconPath + app.config.icons["comment"],
ActionType: "AnalystComment"
}
if (!viewModel.ActionLog) {
viewModel.ActionLog = [];
}
actionLogModel.push(newActionLog); */
But after upgrade to v7 we get error: actionLogModel is undefined.
I managed to get it working for Resolved in this way :
viewModel.AppliesToTroubleTicket = [{
"ActionType": {
"Id": "5ca2cfee-6740-1576-540B-ce17222840b8",
"Name": "Record Resolved"
},
"Description": this.get("comment"),
"EnteredBy": session.user.Name,
"EnteredDate": new Date().toISOString().split(".")[0],
"LastModified": new Date().toISOString().split(".")[0],
"Title": "Record Resolved",
"Image": "/Content/Images/Icons/ActionLogIcons/recordresolved.png",
"BillableTime": {
"BasedId": null,
"DisplayName": null
},
"LastUpdatedDisplay": null
}];
},
But now - analysts need to click on OK before the action log appears.
Worse is that I am unable to convert this for a normal analyst comment - can't find actiontype for this?
Has anyone had the same issue and a solution for this?
Thanks
Answers
Having the same issue.
Do you mind sharing the actiontype id for AnalystComment?
Thanks
var newActionLog = {
Description: this.get("actionLogComment"),
DescriptionDisplay: this.get("actionLogComment"),
EnteredBy: session.user.Name,
EnteredDate: new Date().toISOString().split(".")[0],
LastModified: new Date().toISOString().split(".")[0],
Title: localization.Analyst + " " + localization.Comment,
IsPrivate: this.isPrivate,
Image: (this.isPrivate) ? app.config.iconPath + app.config.icons["privateComment"] : app.config.iconPath + app.config.icons["comment"],
ActionType: "AnalystComment"
}
console.log(this.isPrivate);
if (!viewModel.ActionLog) {
viewModel.ActionLog = [];
}
var actionLogType = app.controls.getWorkItemLogType(viewModel);
if (actionLogType) {
viewModel[actionLogType].push(newActionLog);
}
But don't manage to get this working for other tasks using appliestoworkitem.
I really need the Id for those ones, but can't find it anywhere.
finalsr.AppliesToWorkItem = [{
Description: "Budget has been requested",
DescriptionDisplay: "Budget has been requested",
EnteredBy: session.user.Name,
EnteredDate: new Date().toISOString().split(".")[0],
LastModified: new Date().toISOString().split(".")[0],
Title: localization.Analyst + " " + localization.Comment,
IsPrivate: false,
Image: app.config.iconPath + app.config.icons["comment"],
ActionType: "AnalystComment"
}];
Works for us for Incident:
incident.AppliesToTroubleTicket.push({
"ActionType": "AnalystComment",
"EnteredBy": session.user.Name,
"Title": "Analyst Comment",
"IsPrivate": true,
"EnteredDate": new Date().toISOString().split(".")[0],
"LastModified": new Date().toISOString().split(".")[0],
"Description": "private",
"Image": "/Content/Images/Icons/ActionLogIcons/recordopened/privatecomment.png"
});
Here's an example of a task we have that marks the incident "Pending Affected User Reply" and should also add a comment to the action log. The status change works, but nothing shows up in the action log. Thanks in advance!
Here's my updated action log code--it's working, but the icon is still showing the "Resolved" green check box, even though I changed it to comment.png. I tried changing the ActionType to:
"ActionType": "AnalystComment",
like Olena mentioned above, but when I do that, the action log entry doesn't show up at all. I thought maybe I need to change the ActionType Name to "Analyst Comment", but then I don't know what to put for ActionType Id. Any thoughts?
I appreciate your help!
With this:
ActionType: "AnalystComment",
Another thing that stands out is that "AppliesToWorkItem" is an array, so elements should be pushed to it. The way its written above, the entire Action Log would be replaced with the single entry and it might not be liking that.
Something like this might be better (snippet from elsewhere, so it might not all be relevant here):