Home Analyst Portal
Options

Approve Review Activity Via Custom Task

Valerie_SirouxValerie_Siroux Customer IT Monkey ✭
Hi
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

Answers

  • Options
    Valerie_SirouxValerie_Siroux Customer IT Monkey ✭
    ok - managed to get this almost working.

    But I'm not able to set the VotedBy user to the current user.
    any ideas? 

    Thanks

    function approveRA(decision,comment) {
        var ogrv = decision;
        var newrv = JSON.stringify(ogrv);
        var finalrv = JSON.parse(newrv);
        finalrv.Decision.Id = "0e856c6c-04e5-0a8e-6041-bc7715b4747e"; //approve
        finalrv.Comments = comment;
        finalrv.DecisionDate = new Date().toISOString().split(".")[0];
        var uid = session.user.Id;
        var displayname = session.user.Name;
    finalrv.VotedBy.BaseId = uid;
    //finalrv.VotedBy.DisplayName = displayname;

        var strData = { "formJson": { "original": ogrv, "current": finalrv } }
        console.log(strData);
        $.ajax({
            url: "/api/V3/Projection/Commit",
            type: "POST",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            data: JSON.stringify(strData),
            success: function (data2) {
                console.log(data2);
            }
        });
    }
Sign In or Register to comment.