1 follower Follow

How to create a new task and link it with a project using API

I have created the task and now I want to link the task to Projet and I am using the below code in C#

 Entity link = new Entity();

            link.Id = new EntityId();

            link.Id.TypeName = "WorkItemHierarchyLink";

            //Create a field that references the parent task Id
            FieldValue parentRef = new FieldValue();

            parentRef.FieldName = "Parent";

            parentRef.Value = parentTask.Id;

 if (((ClarizenAPIIntegration.ClarizenSvc.CreateResult)queryResults1).Id.Value.Count()> 0)
                        FieldValue childRef = new FieldValue();

                        childRef.FieldName = "Child";
                        childRef.Value = ((ClarizenAPIIntegration.ClarizenSvc.CreateResult)queryResults1).Id.Value;

                        FieldValue typename = new FieldValue();
                        typename.FieldName = "typeName";
                        typename.Value = "Task";

                        link.Values = new FieldValue[] {


I am not able to create a link between the Project and Task. Please help me

Aneesha M

Please sign in to leave a comment.