2

Is there a method to get all the LiveDoc Documents of a project I want to use this in Scheduler script

Toto
  • 89,455
  • 62
  • 89
  • 125
Anas Hosami
  • 317
  • 1
  • 2
  • 6

1 Answers1

3

Luckily there is a nice function in the API which is never exposed to the Polarion UI (would really like to hear the story about this).

This is a velocity script getting all Documents (They are called "Modules" in the API) in a single project:

#foreach($doc in $trackerService.dataService.searchInstances($trackerService.dataService.getPrototype("Module"), "project.id:$page.project", "space,id"))
* $doc.id
#end 

The API call searchInstances() can find you anything: User, Workitems, Testruns, Documents ,etc.

Peter Parker
  • 29,093
  • 5
  • 52
  • 80
  • Thank you @peter this is exactly what I am looking for I really appreciate your help – Anas Hosami Jun 09 '21 at 15:05
  • If this solves your Problem, you should mark this as the correct answer, so other people can use this answer as well. Otherwise this question stays as unanswered. – Peter Parker Jun 09 '21 at 16:34
  • hi @AnasHosami could you demonstrate how to use it a bit further? – Jane May 23 '23 at 12:19