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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

How to put date value from CLI reulst to date type field

bson21
12-Amethyst

How to put date value from CLI reulst to date type field

Hello

 

I can get date value from CLI like below

command > tm results --caseID=1111 --fields="Modified Date"

output > Sep 25, 2019 11:53:47 AM

outputs can be several.

 

question1 : in case of several outputs, how can I select latest date output?

question2 : how can I put date output to integrity field(date type)

 

Thank you very much

ACCEPTED SOLUTION

Accepted Solutions
bson21
12-Amethyst
(To:awalsh)

First of all, I appreciate your reply

I will use this solution in java script that will be started when test case result modified(modified time criteria is still unclear. it's next problem)

 

but I finally found best solution

The solution is computation function "lastResultDate()"

this function can resolve my request at once.

 

Thank you very much

 

PS. Can I get a document file about computation function list?

       that will be very helpful for me.

View solution in original post

5 REPLIES 5
awalsh
17-Peridot
(To:bson21)

I'm not sure you can get just one result from the tm results command, but you can sort descending by the modified Date. That way the first result returned would be the newest one. To sort, add the following options to your command: --sortField=modifiedDate --nosortAscending

For more information on the options for tm results, see the CLI documentation:

http://support.ptc.com/cs/help/integrity_hc/integrity122_hc/en/#page/IntegrityHelp%2Ftm_results.html%23

 

As for adding the information to a date type field: how are you doing this? I mean, is this a CLI Script (shell, batch) or API program?  Is the date field on the case ID or some other item?  

If this is in a script, then you'll need to read in the output from the tm results command, and save the first value, then you can edit an issue and set the date using the CLI:

 im editissue --field="date field"="Date"  [item ID]

Whether to include the time depends on how the date field is configured.  For more information on editissue command:

http://support.ptc.com/cs/help/integrity_hc/integrity122_hc/en/#page/IntegrityHelp%2Fim_editissue.html%23

bson21
12-Amethyst
(To:awalsh)

First of all, I appreciate your reply

I will use this solution in java script that will be started when test case result modified(modified time criteria is still unclear. it's next problem)

 

but I finally found best solution

The solution is computation function "lastResultDate()"

this function can resolve my request at once.

 

Thank you very much

 

PS. Can I get a document file about computation function list?

       that will be very helpful for me.

awalsh
17-Peridot
(To:bson21)

That's a very good solution! I didn't even think of the functions.

You can find a list of the functions in the online help:

http://support.ptc.com/cs/help/integrity_hc/integrity122_hc/en/#page/IntegrityHelp%2Fserv_comp_comp_expression_functions.mif-1.html%23
awalsh
17-Peridot
(To:bson21)

sorry, already posted link to the functions.

bson21
12-Amethyst
(To:awalsh)

Thank you for your endless concern 🙂

Announcements


Top Tags