Export Tracker using CLI

Question

How to 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

  1. Open CLI client and connect with Prod site
  2. Open Windows command line as administrator
  3. Navigate to CLI setup location (where CLI.exe is saved)
  4. In Windows command line, execute the script by
    • > CLI.exe <script location>
    • Example: > CLI.exe C:\listartifact.ctf
  5. Output will be stored as exportedtracker.csv in the current location of command line.

 

Internal reference: #123823

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.