Home Affected User

API CreateProjectionByCriteria

Lesiba_MalebanaLesiba_Malebana Customer IT Monkey ✭

How do i populate the Affected User field from the API

Answers

  • Shane_WhiteShane_White Cireson Support Super IT Monkey ✭✭✭✭✭

    Hi @Lesiba_Malebana ,

    Thanks for posting this to the community, here is an example using the Bulk Edit API! You can also use the Commit API! Just change the workitem Id to the workitem you want to edit and the edited value is the user Id you want to set the affected user as.

    $.ajax({

            url: '/api/V3/WorkItem/BulkEditWorkItems',

            type: 'POST',

        contentType: 'application/json',

        data:JSON.stringify(

        {

        ProjectionId:"285cb0a2-f276-bccb-563e-bb721df7cdec",

        UpdateServiceManagement:true,

        ItemIds:["8130a4ad-eb38-eca9-531f-01690eb58e17"],

        EditedFields:

            [

        {PropertyName:"RequestedWorkItem",

            PropertyType:"singleCardinalityObject",

            PropertyRelationshipId:"dff9be66-38b0-b6d6-6144-a412a3ebd4ce",

            EditedValue: session.user.Id}

            ]

        }),

            dataType: 'json'

    });

    Let me know if this helps!

    Thanks,

    Shane

Sign In or Register to comment.