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

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

SOLVED
Regular Member

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

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

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

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...

 

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.ht...

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

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

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

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_...

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

sorry, already posted link to the functions.

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

Thank you for your endless concern 🙂

Announcements