intgrtr1 Contributor.
Contributor.
457 views

Update for the commandline fails when certain characters are included in the content

I am using the StarTeam commandline to update fields of a task. The contents of the update can vary depending on the comments entered by the user.

java.exe -jar "C:\Program Files\Micro Focus\StarTeam SDK 16.0\lib\stcmdEx.jar" update Task set (Usr_Field1 = 1.2.3.4 , Usr_Field2 = "12(3.4)" , Usr_Field3 = "Test 1.2.3.4") where ID = 34695 -epwdfile "C:\STARTEAM\LICENSE FILE\AutoStarTeam.bin" -p "AutoStarTeam:@LINC-STAR-01-PP:49201/Test View/Folder"

First, we found that we must use parenthesis when we are updating multiple fields in a single command. Second, we find that the value for Usr_Field2 causes the command to break. By simply adding a space before the parenthesis, the command works. This appears to have broken, because this was not an issue prior to this. The following comand works:

java.exe -jar "C:\Program Files\Micro Focus\StarTeam SDK 16.0\lib\stcmdEx.jar" update Task set (Usr_Field1 = 1.2.3.4 , Usr_Field2 = "12 (3.4)" , Usr_Field3 = "Test 1.2.3.4") where ID = 34695 -epwdfile "C:\STARTEAM\LICENSE FILE\AutoStarTeam.bin" -p "AutoStarTeam:@LINC-STAR-01-PP:49201/Test View/Folder"

You will notice the only difference between the 2 commands is a space in the Usr_Field2 value. I thought that the quotes would indicate that the content is literal, but apparently that is not the case. Is there additional syntax that is missing?

Regards

0 Likes
9 Replies
Micro Focus Expert
Micro Focus Expert

Re: Update for the commandline fails when certain characters are included in the content

Are you using the latest version of the SDK / Command Line from MicroFocus Supportline?

please run stcmd{Ex} version.

If not 16.0.3.61, please upgrade and rerun your command.

If you continue to experience issues, please feel free to continue this thread, or to open a support incident.

I will need to know specifically the types of the properties Usr_Field1, Usr_Filed2 & User_Field3, and the kinds of character strings you are using to execute the update.

I can then run internal tests to see what's going on, and answer your questions.

Take care

Anil

 

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Update for the commandline fails when certain characters are included in the content

Alternately, you may choose to upgrade to SDK build 17.0.0.25, from off supportline.

17.0 is our latest release platform.

 

0 Likes
Highlighted
intgrtr1 Contributor.
Contributor.

Re: Update for the commandline fails when certain characters are included in the content

Hi Anil,

All three Task fields are custom fields that are text fields. The field contents are actually comments taken directly from StarTeam Files. We retrieve the comments from the Files, enclose them in quotes and populate the update command to update the Task fields.

 

Regards

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Update for the commandline fails when certain characters are included in the content

That's good to know, thank you.

Can you also check which version of the command line you are on, please?

As I said, you should be using either 16.0.3.61 or 17.0.0.25

You can also download the command line .pdf from here

ftp://stsdkcust:LpeEFPwNMJ@emeaftp.microfocus.com/ST_CmdTools_Help.pdf

 

It will provide you with the exact supported syntax of the update command.

If you still encounter issues with the latest build, I will need to know a string pattern which is causing issues on update. It may be best to open a support incident with details.

Thanks

anil

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Update for the commandline fails when certain characters are included in the content

fwiw..

>>update Task set (Usr_Field1 = 1.2.3.4 , Usr_Field2 = "12 (3.4)" , Usr_Field3 = "Test 1.2.3.4") where ID = 34695

The way I expect this command to work with our release builds is.

update task set usr_field1 = "1.2.3.4", usr_field2 = "12 (3.4)", usr_field3 = "Test 1.2.3.4" where ID = 34695.

i do not expect parentheses to be needed around the property names being updated.

I do expect all text field values to be enclosed in double quotes.

I expect a comma (,) between each field/property name.

while white space is not mandatory between property names, commas, etc, it typically makes for better readability.

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Update for the commandline fails when certain characters are included in the content

I ran a test using sdk 17.0.0.25 (command syntax & output below)

c:\Program Files\Micro Focus\StarTeam Cross-Platform Client 17>java.exe -jar stcmdEx.jar version
17.0.0.25
Command completed successfully in 181 ms

c:\Program Files\Micro Focus\StarTeam Cross-Platform Client 17>stcmdex update changerequest set synopsis ="test 123", workaround = "testing 456" where number = 1 -p "Administrator:Administrator@localhost:49201/temp/temp"

c:\Program Files\Micro Focus\StarTeam Cross-Platform Client 17>stcmdex update changerequest set synopsis ="test 123", workaround = "testing 456" where changenumber = 1 -p "Administrator:Administrator@localhost:49201/temp/temp"

c:\Program Files\Micro Focus\StarTeam Cross-Platform Client 17>java.exe -jar stcmdEx.jar update changerequest set synopsis ="test 123", workaround = "testing 456" where changenumber = 1 -p "Administrator:Administrator@localhost:49201/temp/temp"
ViewMember ID,CR Number,Work Around
3,1,testing 456
1 rows returned
Command completed successfully in 844 ms

c:\Program Files\Micro Focus\StarTeam Cross-Platform Client 17>

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Update for the commandline fails when certain characters are included in the content

I ran a test using sdk 17.0.0.25 (command syntax & output below)

c:\Program Files\Micro Focus\StarTeam Cross-Platform Client 17>java.exe -jar stcmdEx.jar version
17.0.0.25
Command completed successfully in 181 ms

c:\Program Files\Micro Focus\StarTeam Cross-Platform Client 17>stcmdex update changerequest set synopsis ="test 123", workaround = "testing 456" where changenumber = 1 -p "Administrator:Administrator@localhost:49201/temp/temp"

c:\Program Files\Micro Focus\StarTeam Cross-Platform Client 17>java.exe -jar stcmdEx.jar update changerequest set synopsis ="test 123", workaround = "testing 456" where changenumber = 1 -p "Administrator:Administrator@localhost:49201/temp/temp"
ViewMember ID,CR Number,Work Around
3,1,testing 456
1 rows returned
Command completed successfully in 844 ms

c:\Program Files\Micro Focus\StarTeam Cross-Platform Client 17>

0 Likes
intgrtr1 Contributor.
Contributor.

Re: Update for the commandline fails when certain characters are included in the content

Hi Anil,

That works for us as well. Strangely enough, it is only happening in the particular case where the parenthesis is included and there is no space between the open parenthesis and the previous character. This is using the stcmdEx.jar. 

However, if we went back to using the stcmd command, we would have to remove the parentheses around the multiple update fields and it would work with or without the space before the open parenthesis for usr_Field2.

Regards

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Update for the commandline fails when certain characters are included in the content

>>in the particular case where the parenthesis is included 

Parenthesis around the property names is NOT a supported syntax of the command. It has never been.

The use of unsupported syntax is more than likely to produce unpredictable results.

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.