Post

3 followers Follow
0
Avatar

adding Project and Milestone information to task

Hi,

I am trying to create a task using the API and I need to map this task to a Project and a Milestone using API fields.

But when I try to use the API field ‘Project’ or ‘Milestone’ , I get an XML error stating - “There was an error generating the XML document.”

Please let me know if I am mapping to the correct fields.

Regards,

DEEKSHA SHETTY

Deeksha Shetty Answered

Please sign in to leave a comment.

26 comments

0
Avatar

Hello Deeksha,

If you want a task to be under some project/milestone, please specify them in the Parent field. Please let me know if this works. If not, please provide the code you're using.

Thank you,

Roland

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Hi Roland,

Thank you. Mapping it as a 'Parent' field helped.

I have another question. We can either map a project or Milestone as 'Parent'.

Is there a way to map both Project and Milestone? If so, then what field should it be mapped to?

Deeksha Shetty 0 votes
Comment actions Permalink
0
Avatar

Hi Roland,

Thank you. Mapping it as a 'Parent' field helped.

I have another question. We can either map a project or Milestone as 'Parent'.

Is there a way to map both Project and Milestone? If so, then what field should it be mapped to?

Deeksha Shetty 0 votes
Comment actions Permalink
0
Avatar

Every milestone must live inside a Project and it is a 1-to-1 relationship. So by mapping a task to a Milestone, you are also linking it to the Project as well. If you just map it to the Project, it will be at the same hierarchical level as Milestones, which I don't think is what you want. Please try out the Milestone mapping and let us know how it goes. Thanks!

Josh Santos 0 votes
Comment actions Permalink
0
Avatar

Hi Josh,

Thank you for confirming the relationship.I have tried the parent and it works well.

Thank you.

Regards,

Deeksha

Deeksha Shetty 0 votes
Comment actions Permalink
0
Avatar

Hi Josh,

I got another error while trying to create a task under Milestone.

The error is - "You can only create a task under a project task". But you said i can create one under a Milestone

Deeksha Shetty 0 votes
Comment actions Permalink
0
Avatar

Hi Deeksha,

Please provide a screenshot of the payload.

Thank you,

Roland

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Hi Deeksha,

Please check if there are no validation rules preventing task creation under milestones. Also, does the milestone you're adding the task to already exist in advance or are you creating them at the same time?

Thank you,

Roland

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Hi Deeksha,

I've also looked at the logs and it appears to me that you're trying to create a task named PRESTATION under milestone 38164-F. This is not a valid milestone External ID.

I hope this helps.

Roland

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Hi Roland,

It may not be the valid externalID but that is what is used while creating the Milestone task. I have used my own ID to even create Milestones and Projects. So i dont think that should matter. We have a validation but that is not enabled.

Any other suggestions ?

Deeksha Shetty 0 votes
Comment actions Permalink
0
Avatar

I think the milestone ID would be something like M-51237, otherwise that is not a valid Milestone you can add tasks to.

Josh Santos 0 votes
Comment actions Permalink
0
Avatar

Hi Deeksha,

I think it should actually look something like this: 3ibrscy9sbt2aokp0nvrqdv4k1

I hope this helps.

Roland

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Josh - the ID fields for Milestone starts with 'M-'

Roland - I tried to create the Milestone again and this time with External ID '4d7pxzvyt4ahc77e6wzugvucq3', but still i got the same error.

Deeksha Shetty 0 votes
Comment actions Permalink
0
Avatar

Hi,

Do yu have any other suggestion ? This is a high priority task and needs to be resolved as soon as possible 

Regards,

Deeksha

Deeksha Shetty 0 votes
Comment actions Permalink
0
Avatar

Hi Deeksha,

You don't need to set milestone External ID - it will be assigned by the system upon creation. When that is done, take the milestone's External ID and use that in the task's Parent field.

Please let me know if this helps.

Roland

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Hi Roland,

I have tried this, it is still the same error.

Deeksha Shetty 0 votes
Comment actions Permalink
0
Avatar

Hi Deeksha,

Could you please provide the error ID?

Thank you,

Roland

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

This is the error reference ID - "2b1MhxZw8GcHcID9V7aT8z"

Deeksha Shetty 0 votes
Comment actions Permalink
0
Avatar

This issue is resolved now. 

I created a task and then mapped the parent(either Project or Milestone) using the 'RealWorkItemHierarchyLink'. It worked well

Deeksha Shetty 0 votes
Comment actions Permalink