Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Need help saving Query Results to .csv file automatically daily using RTC java api

Problem: I need the write java code to find my RTC query, run my RTC query, save my RTC query results to a .csv file automatically/daily using a windows scheduler

I have been working on my classes to extend RTC in java and I have this code:


while (resolvedResults.hasNext(monitor)) {
        IResolvedResult result = resolvedResults.next(monitor);
        IWorkItem workItem =  (IWorkItem)result.getItem();
        // do something with the work item<---- I am trying to figure out what should go here in order to save my data to csv file. I am sort of new or getting back into Java coding so any help would be appreciated
        processed++;
    }

So basically i need it to do the file-->export--> choose query-->choose csv file automatically/daily through the api and a windows scheduler

0 votes



One answer

Permanent link
well, I can't help with the CSV part, altho there are csv reader/writer classes available as opensource..

but here is my sample pgm, which executes a named query and then displays all the workitem attributes.

see the accepted answer here
https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes

note that the forum messes with text case, quotes etc.. so there will be a few errors to correct after you cut/paste the code into eclipse.

takes 4 parms
server/ccm
userid
password
query to execute

0 votes

Comments

you can also go to the web UI, execute your query, go to the top right and select the print view. then copy that URL, and you can execute it with curl or whatever too.
not exactly csv format, but close (lose the 1st two lines)

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019
× 10,936

Question asked: Apr 22 '14, 4:54 p.m.

Question was seen: 7,291 times

Last updated: Apr 22 '14, 5:44 p.m.

Confirmation Cancel Confirm