It's all about the answers!

Ask a question

Running WI Export (html or cvs) via Java Client


Moti Wertheimer (18913627) | asked Aug 06 '09, 5:39 a.m.
JAZZ DEVELOPER
I would like to automate some query export (e.g. send it by mail every day)
Is there a way to do it via API?

I can iterate a query results and ask every attribute, but is there a way to perform the same action like exportin items in the UI?

Thanks,
Moti

2 answers



permanent link
Patrick Streule (4.9k21) | answered Aug 07 '09, 5:12 a.m.
JAZZ DEVELOPER
I would like to automate some query export (e.g. send it by mail every
day)
Is there a way to do it via API?

I can iterate a query results and ask every attribute, but is there a
way to perform the same action like exportin items in the UI?

The HTML and CSV export can be called via URL, which is probably the most
convenient way for you (I assume you would have a shell script which is
run once a day and could get the export using e.g. 'curl').

The URLs are of the form

https://jazz.net/jazz/resource/itemOid/com.ibm.team.workitem.query.QueryDescriptor/_g6IlwDWTEd6mccAyNHwwhQ?_mediaType=text/csv

To find the URL for your particular query, you can look at the links of
the 'Download as Spreadsheet' and 'View ... in Printable Format' buttons
in the Web UI.

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Moti Wertheimer (18913627) | answered Aug 13 '09, 3:46 a.m.
JAZZ DEVELOPER
Thanks a lot Patric,

This script is working for me:

curl -k -c .\cookies.txt "https://<repository>:9943/jazz/authenticated/identity" > temp.html

curl -k -L -b .\cookies.txt -c .\cookies.txt -d j_username=%1 -d j_password=%2 https://<repository>:9943/jazz/authenticated/j_security_check > temp.html

curl -k -b .\cookies.txt https://<repository>:9943/jazz/resource/itemOid/com.ibm.team.workitem.query.QueryDescriptor/_pz6r4HdoEd6zr914Fr4kGg?_mediaType=text/csv > QueryResult.csv

Regards,
Moti

Your answer


Register or to post your answer.