JonathanMC
New Member.
687 views

How do I undelete a feature that I deleted in error?

 
0 Likes
9 Replies
Micro Focus Expert
Micro Focus Expert

Re: How do I undelete a feature that I deleted in error?

today there is no option to undelete.

What you can do is to try and reconstruct it's data from history rest api.

If this is relevant, reply here and I will add set of instructions on how to do that.

0 Likes
NEW_ALM12 Outstanding Contributor.
Outstanding Contributor.

Re: How do I undelete a feature that I deleted in error?

@alex-shnayder Woul dyou please instruct how to recover any artiafcts that are deleted with in Workspace or in Ocatne?

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: How do I undelete a feature that I deleted in error?

In general at the moment ALM Octane does not support archiving or recycle bean like functionality, so when you delete some thing there is no quick way to restore it.

One possible way to restore the data but not quite the entity itself is to use rest audit api to retrieve field values of an entity at time of deletion, with that you can manually recreate deleted entity with those value.

I will ask a colegue to provide more info on this thread regarding the audit api

0 Likes
NEW_ALM12 Outstanding Contributor.
Outstanding Contributor.

Re: How do I undelete a feature that I deleted in error?

Any update on how to restore a WorkSpace, if we need to?

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: How do I undelete a feature that I deleted in error?

You can use the following REST API to get deleted entities

 

http://{{server name}}/api/shared_spaces/{{sharedSpaceId}}/workspaces/{{workspaceID}}/historys?query=”entity_type=^feature^;action=^delete^”

 

This will return all deleted features with their values

 

you can also add creation time or the entity id, to minimize the results set

 

for example search between dates

http://localhost:8080/api/shared_spaces/1001/workspaces/1002/historys?query=”entity_type=^feature^;action=^delete^;(creation_time>=^2019-03-03T22:00:00Z^;creation_time<=^2019-03-07T21:59:59Z^)”

 

for example search by entity id:

http://localhost:8080/api/shared_spaces/1001/workspaces/1002/historys?query=”entity_type=^feature^;action=^delete^;entity_id=1004

 

 

from version 12.60.35 we have a new API to get history data:

 

getting only delete action

http://localhost:8080/api/shared_spaces/1001/workspaces/1002/history_logs?query=”entity_type=^feature^;action=^delete^

 

getting entity by id and subtype

http://localhost:8080/api/shared_spaces/1001/workspaces/1002/history_logs?query=”entity_id=1004;entity_type=^feature^”

 

search between dates:

http://localhost:8080/api/shared_spaces/1001/workspaces/1002/history_logs?query=”entity_type=^feature^;action=^delete^;(timestamp>=^2019-03-01T22:00:00Z^;timestamp<=^2019-03-07T21:59:59Z^)”

mikesmithson Valued Contributor.
Valued Contributor.

Re: How do I undelete a feature that I deleted in error?

This API call could be a lifesaver! 

Is it possible to get an example that could be plugged into the browser like other calls?

I've replaced the http with https and the URL for our server, changed the shared space and workspace id, etc. but cannot get past the errors:

{"error_code":"platform.web_application","correlation_id":"neqmw2edzz7ddfdezyn6dw5z7","description":"Syntax error in 'query' query parameter : token recognition error at: '”'. line 1, char 0, Input string : ”entity_id=1004;entity_type=^feature^”","description_translated":"Syntax error in 'query' query parameter : token recognition error at: '”'. line 1, char 0, Input string : ”entity_id=1004;entity_type=^feature^”","properties":null,"business_error":false}

If it's not possible to return the values with a simple browser call, that's cool but I don't have access to build a solution in Java so maybe some other "simple" way to get this info? 

0 Likes
mikesmithson Valued Contributor.
Valued Contributor.

Re: How do I undelete a feature that I deleted in error?

Figured it out!
Space ID must include the "#" -> 11001#
0 Likes
SinthuK
Member.

Re: How do I undelete a feature that I deleted in error?

We dont get the desired result using this api.

I tried using the below

https://<URL>/api/shared_spaces/[space]/workspaces/[workspace#]/historys?query="entity_type=^feature^;action=^delete^"

Can you help with a working model or provide more details on this

 

0 Likes
mikesmithson Valued Contributor.
Valued Contributor.

Re: How do I undelete a feature that I deleted in error?

I was able to get back a list of the deleted records and some details using this.

Logging into Octane first then pasting the URL into another Chrome tab seems to resolve the initial login issue. Few of the examples work without some messing around with the syntax a bit. 

  • SaaS syntax is probably different than on-prem
  • Try "simpler" URL examples until you get something that works then build on that - a lot of the challenges are getting the correct values for things like [workspace#] -> 2001, etc.
  • This syntax only returns the deleted content - with all the tags and xml noise so it'll need to be cleaned up and the results added manually or possible finding a way to import the results back in.

 

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.