E.g, on our system:
https://teampulse.edmi.co.nz/api/workitems/20698 - works (task)
https://teampulse.edmi.co.nz/api/workitems/20697 - error 500 (story)
https://teampulse.edmi.co.nz/api/workitems/21608 - error 500 (bug)
When it fails, the message is:
<Error>
<Message>An error has occurred.</Message>
</Error>
All the above can be accessed in the UI
4 Answers, 1 is accepted
Get tasks and Get other type of workitems have different endpoints:
GET task:
/api/tasks/<taskId>
So in your case it should be:
https://teampulse.edmi.co.nz/api/tasks/20698
GET story(or other work item type):
/api/workitems/<storyId>
Can you make sure that the item that is returned successfully is actually task with id: 20698, but not other work item type.
You can compare the ids and the URL from the UI (open dev tools with F12, and observe under Network tab) and the one in the API call, and see if there is difference in the TeamPulse link, headers, content type, authentication or itemId.
You can read more about TeamPulse API in our documentation.
Let me know if you need any further assistance.
Regards,
Liliya
Telerik
Hi Liliya:
So:
1. I can't find any docs for the "task" API, except that "time entries" references it: http://docs.telerik.com/teampulse/developer-api-guide/Reference/Time-Entries
2. The /workitems/ API *can* access tasks, e.g. where 20866 is a task, then:
https://teampulse.edmi.co.nz/api/workitems/20866 returns what I need.
3. It cannot access stories or bugs, so for story 20865 https://teampulse.edmi.co.nz/api/workitems/20685
I get: An error has occurred
and for bug 22402 https://teampulse.edmi.co.nz/api/workitems/22402
I get: An error has occurred
(Same for features)
This seems to be the inverse of your post above.
My requirement is to take any work item id (task or bug, mostly) and find the parent/related items.
Actually, this is an authentication issue.
I was testing by accessing the API in a browser with Teampulse logged in, and in that case, only tasks are accessible.
If I get an access token in my Java environment (without the TP session), then I can access stories. (and tasks via the workitems API)
I think the API might be more consistent and return 401 for no access though.
I`m glad that you manage to find the problem.
You have point for the error code returned. We`ll consider reworking those.
Do not hesitate to contact us in case you need any further assistance.
Regards,
Liliya
Telerik