Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataService API withHistory=true does not return history #122

Open
bulburDE opened this issue Nov 2, 2021 · 1 comment
Open

DataService API withHistory=true does not return history #122

bulburDE opened this issue Nov 2, 2021 · 1 comment
Labels

Comments

@bulburDE
Copy link

bulburDE commented Nov 2, 2021

Affected Version(s)
7.6.6.0

Describe the bug
I am trying to get the history of parts and characteristics using the Data Service API, but the history field is missing in the response.
In the planner I can see that the part has multiple versions. Also the "versioning active"(DE: Versionierung aktiv) checkbox in the top right corner of the planner is checked.

It seems like only the GET /parts endpoint is affected. I can successfully get the history of a characteristic using GET /characteristics

To Reproduce
Steps to reproduce the behavior:

  1. Call the Data Service API at https://piweb-1.app.corpintra.net/MBC/dataServiceRest/parts?partPath=/TEST/PART/WITH/HISTORY&withHistory=true
  2. Get the following response: {'attributes': {}, 'path': 'PPPP:/TEST/PART/WITH/HISTORY', 'charChangeDate': '2021-07-28T07:38:53.537Z', 'uuid': 'fd06b9f4-7a92-4c47-82ac-85584a7f4e40', 'comment': "test comment'.", 'version': 33607, 'timestamp': '2019-07-05T05:58:40.617Z'}

Expected behavior
The endpoint GET /parts should return the version history if withHistory=true is set.

@bulburDE bulburDE added the bug label Nov 2, 2021
@czthiele
Copy link
Contributor

czthiele commented Nov 3, 2021

Hello @bulburDE,

it is important to distinguish between the API and the Planner at this point: when using the version overview in PiWeb Planner and clicking on a part, you will see all changes of this part and its characteristics. So it is possible that the multiple versions which you see are actually only changes of characteristics. The API however will return only part history on the parts endpoint and characteristic history on the characteristics endpoint, the Planner later combines it. You could try to actually edit the part atributes (e.g. rigth click on the part -> edit attributes) to create a new version of the part. Then the response of the parts endpoint should contain history, I tried it myself using PiWeb 7.6.6.

I hope this helps and clears things up a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants