Polarion 2310 REST API - how to get linked work items from different projects?

Hi, I don’t see many questions on the Polarion REST API here, but the documentation links to this community forum. If there’s a better place for this question please let me know.

Our org has many Polarion projects, with many work items in different projects linked to each other. I would like to use a REST API to get all the linked work items for a given work item. My problem is that the API I’m using only includes linked work items from within the specified project, not other projects.

So assume I have ProjectA and ProjectB, and ProjectA has WorkitemA1 and WorkItemA2 and ProjectB has WorkItemB1. And WorkItemA1 is linked to both WorkItemA2 and WorkItemB1. I can see they are linked to each other through the Polarion web app, it shows both links on the page for WorkItemA1, even WorkItemB1 which is in ProjectB.

If I try to get this same info via REST API, I can do getLinkedWorkItems like this:
GET /projects/ProjectA/workitems/WorkItemA1/linkedworkitems
But this will only return WorkItemA2 as a linked work item. If I try something like
GET /projects/ProjectB/workitems/WorkItemA1/linkedworkitems
That of course return Not Found, presumably because WorkItemA1 is not in ProjectB. But I don’t see a way to specificy “for WorkItemA1 in ProjectA, get me linked work items in ProjectB” OR just “get me ALL linked work items”.

How can I do this?

Hi @richard.podraza

Polarion has a dedicated community which can be found here.

https://community.sw.siemens.com/s/topic/0TO4O000000MihxWAC/polarion

I will leave this topic open but the product community is probably a better place to ask questions.

I also looked a bit at the API (I am not a polarion expert) and there seems to be an include parameter (example is here )

Example Request:

GET /polarion/rest/v1/projects/myProject/workitems/WI-1?include=linkedWorkItems,linkedWorkItems.workItem&fields[workitems]=title&fields[linkedworkitems]=@all

however I don’t really know if that works cross projects.

Happy holidays!

Thanks! I did eventually find that doc you listed, and it’s true that some combination of fields/relationships arguments is looking like what I need. I did not know about the forum you linked to, so thanks for that and I hope to use it in the future.

1 Like