Skip to main content
12-Amethyst
November 13, 2024
Solved

Update Stamp via WRS REST API

  • November 13, 2024
  • 4 replies
  • 1145 views

Version: Windchill 12.1

 

Use Case: I need to retrieve documents that were set to released in the past 24 hours.


Description:

I am looking to find documents that were set to released in the past 24 hours. I am doing this via InfoEngine by querying for objects with an UpdateStamp greater than a date/time stamp for yesterday.

In InfoEngine updateStamp and modifyStamp are returned and represent two different use cases. I need updateStamp. Below is the values I am seeing come back from InfoEngine

 

<thePersistInfo.updateStamp>2024-05-24 13:01:13 EDT</thePersistInfo.updateStamp>
<thePersistInfo.modifyStamp>2024-05-16 09:49:15 EDT</thePersistInfo.modifyStamp>

 

The DynamicDocument Rest API returns LastModified, which seems to align with modifyStamp from InfoEngine, but I am not seeing a value come back from the REST API's for UpdateStamp.

 

{
...
"LastModified": "2024-10-25T12:56:32-04:00",
...
}

 

I am able to get the documents that were modified after a given date timestamp with the following query.

 

LastModified gt 2024-10-24T15:39:10-04:00 

 

 Is there a way to query against the updateStamp field available from InfoEngine via the REST API's? 

Best answer by AdamElkins

@MalteSiefkes provided the information that got me to the solution. I did the following.

  1. Updated "<Windchill>\codebase\rest\custom\domain\DynamicDocMgmt\v4\entity\DynamicDocumentsExt.json". Note that "v4" indicates this change will only show up for the API Version 4 API request.

 

{
 "extends": "DynamicDocument",
 "attributes": [
 { 
	"name":"UpdateStamp",
	"internalName":"thePersistInfo.updateStamp",
	"type":"DateTimeOffset",
	"readOnly": true
	}
 ]
}

 

 

4 replies

HelesicPetr
22-Sapphire II
22-Sapphire II
December 4, 2024

Hi @AdamElkins 

I would say that you can create own report in the Windchill by queryBuilder and then call this report with the RestAPI

Thanks that you can get anything you need even though the RestApi does not support everything . 

PetrH

13-Aquamarine
December 13, 2024

You can extend the Product Management Domain with a supported customization.

Extend WRS to include PersistInfo.UpdateStamp:

Follow https://support.ptc.com/help/windchill/r13.0.1.0/en/index.html#page/Windchill_Help_Center/WCRESTFramework/WCCG_RESTAPIsAddCustomProperties.html#

And add to PartsExt.json:

    "attributes": [

        {   

            "name":"UpdateStamp",

            "internalName":"thePersistInfo.updateStamp",

            "type":"DateTimeOffset",

            "readOnly": true

        },

 

Restart Windchill

12-Amethyst
January 10, 2025

Thank you @MalteSiefkes this did work.

Community Moderator
December 18, 2024

Hi @AdamElkins,

 

I wanted to see if you got the help you needed.

If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Please note that industry experts also review the replies and may eventually accept one of them as solution on your behalf.
Of course, if you have more to share on your issue, please pursue the conversation. 

 

Thanks,
Anurag 

 

12-Amethyst
December 18, 2024

I haven't gotten a chance to look back into this yet but will update this thread once I do.

AdamElkins12-AmethystAuthorAnswer
12-Amethyst
January 10, 2025

@MalteSiefkes provided the information that got me to the solution. I did the following.

  1. Updated "<Windchill>\codebase\rest\custom\domain\DynamicDocMgmt\v4\entity\DynamicDocumentsExt.json". Note that "v4" indicates this change will only show up for the API Version 4 API request.

 

{
 "extends": "DynamicDocument",
 "attributes": [
 { 
	"name":"UpdateStamp",
	"internalName":"thePersistInfo.updateStamp",
	"type":"DateTimeOffset",
	"readOnly": true
	}
 ]
}