Approve Review Activity Via Custom Task
I'm trying to create a custom task on a Service Request.
Goal is to have this task displayed for the RA Approver(s). Using this task he/she is required to provide additional information (for the budget) - and approve the RA itself.
I'm able to ask for the additional information - and saving this on additional SR fields. But approving the review activity seems to be a lot more difficult. Has anyone done this before? Or does anyone have a start for this?
Thanks!
Valérie
Best Answer
-
Roland_Kind Partner Advanced IT Monkey ✭✭✭Hi,
as far as I know a User (approver) is also a related class - and therefore you must include something like:
data.CreatedWorkItem = [{
"ClassTypeId": "eca3c52a-f273-5cdc-f165-3eb95a2b26cf",
"BaseId": session.user.Id,
"DisplayName": session.user.Name
}];
and then you must include the relationship in the data.NameRelationship array
something like (please note this is just an example)
var xx;
xx = [{Name: "RelatesToWorkItem", RelationshipId: "cb6ce813-ea8d-094d-ee5a-b755701f4547"}] ;
data.NameRelationship = data.NameRelationship.concat (xx);
I have used this approach converting workitems e.g. from sr to ir
5
Answers
But I'm not able to set the VotedBy user to the current user.
any ideas?
Thanks
as far as I know a User (approver) is also a related class - and therefore you must include something like:
data.CreatedWorkItem = [{
"ClassTypeId": "eca3c52a-f273-5cdc-f165-3eb95a2b26cf",
"BaseId": session.user.Id,
"DisplayName": session.user.Name
}];
and then you must include the relationship in the data.NameRelationship array
something like (please note this is just an example)
var xx;
xx = [{Name: "RelatesToWorkItem", RelationshipId: "cb6ce813-ea8d-094d-ee5a-b755701f4547"}] ;
data.NameRelationship = data.NameRelationship.concat (xx);
I have used this approach converting workitems e.g. from sr to ir