Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
72:custom_reports_getting_started_example [2019/02/15 19:28] – ext-bkkr | 72:custom_reports_getting_started_example [2024/02/15 00:00] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 34: | Line 34: | ||
</ | </ | ||
- | We use the global variable pkit to call the method | + | We use the global variable pkit to call the method getCurrentProject() to get a handle on the project of the current metric. The method returns the current project. |
- | Now we call the method | + | Now we call the method getEntities() with the parameter " |
- | And now we try to get all Artifacts which are available in the process. So we call <font inherit/ | + | And now we try to get all Artifacts which are available in the process. So we call getEntities() with the parameter " |
+ | |||
+ | < | ||
+ | for (i = 0; i < | ||
+ | var artifacts_instances = | ||
+ | | ||
+ | </code> | ||
+ | |||
+ | Now we iterate through all artifacts to get the instances of the artifacts, that means the configuration management controlled files. So we call getEntities() with the parameter " | ||
+ | |||
+ | < | ||
+ | for (j = 0; j < | ||
+ | var artifacts_revisions = | ||
+ | |||
+ | | ||
+ | </ | ||
+ | |||
+ | Now we do the same with the revisions of an instance. Each instance has several revisions. But as you can see later we use only one revision, the latest one. As a result we have a variable with all revisions artifacts_revisions. | ||
+ | |||
+ | < | ||
+ | if (artifacts_revisions.length == 0) { | ||
+ | | ||
+ | } else { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | Now we check if a revision exists for an instance. If not then we fill the State column by calling the method dataset.setColumnValue() with a string "no version" | ||
+ | |||
+ | < | ||
+ | dataset.setColumnValue(" | ||
+ | | ||
+ | </code> | ||
+ | |||
+ | We retrieve the document name from the property " | ||
+ | |||
+ | The last action to perform is to save the row by calling the method dataset.storeResultRow() with the two columns " | ||
+ | |||
+ | < | ||
+ | dataset.storeResultRow(); | ||
+ | </ | ||