cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How can I print information about the label in source control system ?

아한
10-Marble

How can I print information about the label in source control system ?

Hi!

My company manage baseline by label.

so we want to show label in 'view projects' when we use 'shared project' function...

but, I have heard it's not possible...or waiting for being answered of "Idea" page in this site.

then, is it possible to get [project & rivision & label] information when I use 'si report' command ?

I checked that there is  [project & revision] information, but label is not exported.

ACCEPTED SOLUTION

Accepted Solutions
alabonte
14-Alexandrite
(To:아한)

Hello 아름 한,

To gather the labels from the checkpoints of the project history, we will need to run another command in addition to the one above.

I have created a batch file that will prompt the user for which Server to connect to, which Port to use, which User to use, which Project you are polling, and the File Name to output the information to. You can copy this batch file and modify it for your use. You can change the fields returned by modifying the --fields argument. For si viewprojecthistory your --fields options are: associatedIssues, author, date, description, labels, revision, and state. For si viewproject your --fields options are: attributes, cpid, labels, memberarchive, memberdescription, memberrev, name, state, symboliclink, and type. You can add/remove and change the order of these --fields options to get the output to your desired organization.

The bat file:

ECHO off

set /p UserInputHostname= Please enter the hostname of the Integrity Server to connect to:

set /p UserInputPort= Please enter the port that the server is listening on:

set /p UserInputUserName= Please enter the username to use:

set /p UserInputProject= Please enter the project name (full path):

set /p UserInputFile= Please enter the filename for the output file:

si viewprojecthistory --hostname=%UserInputHostname% --port=%UserInputPort% --user=%UserInputUserName% --fields=description,labels,revision -P %UserInputProject% >> Temp.txt

si viewproject --hostname=%UserInputHostname% --port=%UserInputPort% --user=%UserInputUserName% --fields=name,type,memberrev,labels -P %UserInputProject% >> Temp.txt

copy Temp.txt %UserInputFile%

del Temp.txt

ECHO Please see %UserInputFile% for the output of project %UserInputProject%

You can then open the file defined by the user as %UserInputFile% with Excel, using space delimiting, and continue on with Excel as you normally would.

View solution in original post

5 REPLIES 5
alabonte
14-Alexandrite
(To:아한)

Hello 아한,

Thank you for your inquiry to manage Checkpoint (Baseline) by Project Label.

You can do this in the GUI, when you open a project. The wizard will give you options to open a project, then you can select the type of project to open, Normal, Variant, or Build (Build is then branched off to select by Revision or by Label). Select Build, then Label, and select the label given previous to this Checkpoint(Baseline).

You can also access this information via the CLI. You can use the command:

  • si viewproject --projectRevision=Label -P /Project/SubProject/project.pj
아한
10-Marble
(To:alabonte)

Thank you for your reply.

It is a little different thing that I want.

Our company want to show like this image. We want to show all subproject's labels of  'test_bd_icu' project. (in that time, all shared projects are build option.)

But I don't hear about that anything.(I posted up this in 'ideas' broad)

So I'm finding workaround.

When I select 'test_bd_icu' project, I export a excel to show all subproject's labels.

alabonte
14-Alexandrite
(To:아한)

Hello 아한

You can work around this by using the Command Line Interface. With this interface we can also output to a text file for you to open with Excel, to show all the subproject labels.

The command is:

     si viewproject --hostname=<1> --port=<2> --user=<3> --fields=name,type,memberrev,labels -P <4> >> <5>.txt

          Where:

               <1> is the hostname of your server (eg. localhost or DNS name)

               <2> is the port that your server listens on (eg. 7001)

               <3> is the username to run the command with

               <4> is the project to focus on (eg. /Projects/Testproject/project.pj)

               <5> is the file name to output to

          A completed command should look like this:

               si viewproject --hostname=localhost --port=7001 --user=username --fields=name,type,memberrev,labels -P /Projects/Testproject/project.pj >> Test.txt

This will create a file "Test.txt" in the <IntegrityClientInstall>/bin folder.

You can then open this file in Excel, using space delimiting, and continue on with Excel as you normally would.

아한
10-Marble
(To:alabonte)

Hi, Adam Labonte

I tried those CLI command. and then this is not shown about the label of the shared-build-subproject.

SITest.pj (1.3) has label.

and the exported test.csv is...

So, Is there a method of showing the label "sandbox_subprojecttest3-1.0.1"  in  this printout?

alabonte
14-Alexandrite
(To:아한)

Hello 아름 한,

To gather the labels from the checkpoints of the project history, we will need to run another command in addition to the one above.

I have created a batch file that will prompt the user for which Server to connect to, which Port to use, which User to use, which Project you are polling, and the File Name to output the information to. You can copy this batch file and modify it for your use. You can change the fields returned by modifying the --fields argument. For si viewprojecthistory your --fields options are: associatedIssues, author, date, description, labels, revision, and state. For si viewproject your --fields options are: attributes, cpid, labels, memberarchive, memberdescription, memberrev, name, state, symboliclink, and type. You can add/remove and change the order of these --fields options to get the output to your desired organization.

The bat file:

ECHO off

set /p UserInputHostname= Please enter the hostname of the Integrity Server to connect to:

set /p UserInputPort= Please enter the port that the server is listening on:

set /p UserInputUserName= Please enter the username to use:

set /p UserInputProject= Please enter the project name (full path):

set /p UserInputFile= Please enter the filename for the output file:

si viewprojecthistory --hostname=%UserInputHostname% --port=%UserInputPort% --user=%UserInputUserName% --fields=description,labels,revision -P %UserInputProject% >> Temp.txt

si viewproject --hostname=%UserInputHostname% --port=%UserInputPort% --user=%UserInputUserName% --fields=name,type,memberrev,labels -P %UserInputProject% >> Temp.txt

copy Temp.txt %UserInputFile%

del Temp.txt

ECHO Please see %UserInputFile% for the output of project %UserInputProject%

You can then open the file defined by the user as %UserInputFile% with Excel, using space delimiting, and continue on with Excel as you normally would.

Announcements


Top Tags