When you need to run a saved Project Tracker query or report repeatedly, you can write a shell script using the cURL utility to automate the process of running the query or report and exporting it to a spreadsheet format, from which it can be extracted for analysis by an external tool, such as a spreadsheet.
cURL is a command line tool for getting or sending files using URL syntax. It supports a range of common Internet protocols, such as HTTP, HTTPS, FTP, and FTPS. For more information about cURL, see the cURL project web site.
Note: To use this example code, you must have cURL installed locally. You will also need a working knowledge of Project Tracker, HTML, HTTP, and shell scripting.
To create a script, follow these steps.
Note: The string follows the pattern <a href="[URL]">[query name]</a>. Copy only the [URL] portion of the string to use in your script. For example, suppose the query returns this URL:
https://project.example.com/servlets/Scarab/curmodule/
2491/remcurreport/true/template/IssueList.vm?queryId=2025
&action=Search&eventSubmit_doSearch=Search&searchsp=asc&
resultsperpage=-1&attv=__11&attv=__188&attv=__3&attv=__16&attv=
__178&attv=__173&attv=__179&attv=__4&attv=__7&attv=__177&attv=
__174&attv=__22&attv=__5&attv=__175&attv=__19&attv=__176&
searchscfoi=0&searchscai=3&format=excel&intake-grp
=mv&intake-grp=attv&intake-grp=query&intake-grp=search&
searchsctoi=0&curmitlistid=1245
You will use these to build the command.
curl -c cookies.txt -d 'loginID=[Login]&password=[password]&Login=Login'
'http://[domain]/servlets/Login?Button=Login'
Notes:
-k option, which suppresses certificate validation and allows cURL to connect to SSL sites without certificates. For help defining the commands for SSL-enabled sites, see the cURL user documentation.-k option to suppress certificate verification should only be used if you can verify the server's authenticity in some other way.openssl pkcs12 -in /director/folder/hp.p12 -clcertificates -out private.pemcurl -b cookies.txt -d 'queryId=125&action=Search&eventSubmit_doRunstoredquery=Search&curmitlistid=140' 'http://[project name].[domainname]/servlets/Scarab/remcurreport/true/template/IssueList.vm'>[query].xls
curl -b cookies.txt -d 'report_id=100&eventsubmit_dogeneratereport=foo&action=ConfigureReport' 'http://[project name].[domain name]/servlets/Scarab/template/reports%2CReportList.vm'>[report].xls