Any update on the above question ?
Regards,
Deeksha
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
Please sign in to leave a comment.
Any update on the above question ?
Regards,
Deeksha
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
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?
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?
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!
Hi Josh,
Thank you for confirming the relationship.I have tried the parent and it works well.
Thank you.
Regards,
Deeksha
Excellent, glad to hear!
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
Hi Deeksha,
Please provide a screenshot of the payload.
Thank you,
Roland
Does this help?
Hi Deeksha,
Could you please provide the payload in JSON format? A working example:
POST https://api.clarizen.com/V2.0/services/data/createAndRetrieve
{
"Entity": {
"id": "/Task/",
"Name": "Some name",
"Parent": "/Milestone/3ibrscy9sbt2aokp0nvrqdv4k1"
},
"Fields": [
"StartDate",
"DueDate"
]
}
Thank you,
Roland
I am not sure how to do that
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
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
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 ?
I think the milestone ID would be something like M-51237, otherwise that is not a valid Milestone you can add tasks to.
Hi Deeksha,
I think it should actually look something like this: 3ibrscy9sbt2aokp0nvrqdv4k1
I hope this helps.
Roland
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.
Hi,
Do yu have any other suggestion ? This is a high priority task and needs to be resolved as soon as possible
Regards,
Deeksha
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
Hi Roland,
I have tried this, it is still the same error.
Hi Deeksha,
Could you please provide the error ID?
Thank you,
Roland
This is the error reference ID - "2b1MhxZw8GcHcID9V7aT8z"
This issue is resolved now.
I created a task and then mapped the parent(either Project or Milestone) using the 'RealWorkItemHierarchyLink'. It worked well