Question
How do I export all artifacts in a Tracker using CLI?
Solution
Exporting all artifact data in a Tracker is possible using a CLI script. Below is a sample script for exporting all artifacts in a particular Tracker.
output exportedtracker.csv
go tracker1045
export -header id,title,assignedTo,createdBy,createdDate,description
items
foreach
ctf set ID `print id`
ctf set TITLE `print title`
ctf set ASSIGNEDTO `print assignedTo`
ctf set CREATEDBY `print createdBy`
ctf set CREATEDDATE `print createdDate`
ctf set DESCRIPTION `print description`
export"$ID","$TITLE","$ASSIGNEDTO","$CREATEDBY","$CREATEDDATE","$DESCRIPTION"
Replace tracker Id in line 2 appropriately. Artifact fields can be added based on the need. To know the exact artifact fields used in a Tracker, use the commands below in CLI:
go <artfId>
fields
Steps to execute the script from Windows CLI client
- Open CLI client and connect with Prod site
- Open Windows command line as administrator
- Navigate to CLI setup location (where CLI.exe is saved)
- In Windows command line, execute the script by
- CLI.exe <script location>
- Example: CLI.exe C:\listartifact.ctf
- Output will be stored as exportedtracker.csv in the current location of the command line.
Internal reference: #123823
Comments
Please sign in to leave a comment.